Last active
July 18, 2016 14:54
-
-
Save uroybd/619a53e20814ae043e29b133d20fbc40 to your computer and use it in GitHub Desktop.
URI 1914
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verdict(P1,P2,C1,C2,M,N): | |
if (M + N) % 2 == 0: | |
v = 'PAR' | |
else: | |
v = 'IMPAR' | |
if C1 == v: | |
return P1 | |
else: | |
return P2 | |
QT = int(input()) | |
for i in range(QT): | |
p1, c1, p2, c2 = input().split(' ') | |
m, n = list(map(lambda x: int(x), input().split())) | |
print(verdict(p1,p2,c1,c2,m,n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment