File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ from collections import deque
2
+ from sys import stdin
3
+ lines = deque (line .strip () for line in stdin .readlines ())
4
+
5
+ def nextline ():
6
+ return lines .popleft ()
7
+
8
+ def types (cast , sep = None ):
9
+ return tuple (cast (x ) for x in strs (sep = sep ))
10
+
11
+ def ints (sep = None ):
12
+ return types (int , sep = sep )
13
+
14
+ def strs (sep = None ):
15
+ return tuple (nextline ()) if sep == '' else tuple (nextline ().split (sep = sep ))
16
+
17
+ def main ():
18
+ # lines will now contain all of the input's lines in a list
19
+ T = int (nextline ())
20
+ for testCase in range (1 , T + 1 ):
21
+ n , m , k = ints ()
22
+ min_k = max (n , m )
23
+ if min_k > k :
24
+ print (- 1 )
25
+ continue
26
+ if (n - m ) % 2 == 0 :
27
+ if k % 2 == n % 2 :
28
+ print (k )
29
+ continue
30
+ print (k - 2 )
31
+ continue
32
+ print (k - 1 )
33
+
34
+ def __starting_point ():
35
+ main ()
36
+
37
+ __starting_point ()
You can’t perform that action at this time.
0 commit comments