Skip to content

Commit 0a5da51

Browse files
authored
Create solution_4.py
1 parent ea159f3 commit 0a5da51

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

problem_1/solution_4.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
q = int(input())
2+
for i in range(q):
3+
a, b, k = list(map(int, input().split()))
4+
if a < b:
5+
a, b, = b, a
6+
if a > k:
7+
print(-1)
8+
elif a % 2 == b % 2 != k % 2:
9+
print(k - 2)
10+
elif (a + b) % 2 != 0:
11+
print(k - 1)
12+
else:
13+
print(k)

0 commit comments

Comments
 (0)