-
-
Save GaZ3ll3/7c842423203123f941a3 to your computer and use it in GitHub Desktop.
google code jam 2015 qround
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
import sys | |
cases = int(raw_input()) | |
for c in xrange(cases): | |
# read in misc problem constants | |
x, y, z = map(int, raw_input().split()) | |
if x == 1: | |
print "Case #%d: GABRIEL" % ((c+1)) | |
if x == 2: | |
if ((y * z)% 2 == 0): | |
print "Case #%d: GABRIEL" % ((c+1)) | |
else: | |
print "Case #%d: RICHARD" % ((c+1)) | |
if x == 3: | |
if ((y * z) % 3 == 0): | |
if (y == 1 or z == 1): | |
print "Case #%d: RICHARD" % ((c+1)) | |
else: | |
print "Case #%d: GABRIEL" % ((c+1)) | |
else: | |
print "Case #%d: RICHARD" % ((c+1)) | |
if x == 4: | |
if ((y * z) % 4 == 0): | |
if (y == 1 or z == 1): | |
print "Case #%d: RICHARD" % ((c+1)) | |
elif (y == 2 or z == 2): | |
print "Case #%d: RICHARD" % ((c+1)) | |
elif (y == 3 or z == 3): | |
print "Case #%d: GABRIEL" % ((c+1)) | |
else: | |
print "Case #%d: GABRIEL" % ((c+1)) | |
else: | |
print "Case #%d: RICHARD" % ((c+1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment