Created
January 18, 2020 14:06
-
-
Save anmolj7/ea451e6b16a448f120f76e7afd4bab28 to your computer and use it in GitHub Desktop.
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
from math import sqrt, floor | |
T = int(input()) | |
for _ in range(T): | |
power = int(input()) | |
k = -0.5+sqrt(1+2*power)/2 | |
if k == floor(k): | |
k -= 1 | |
k = floor(k) | |
sum_bef = (k*(4+4*k))/2 | |
bw = 4+k*4 | |
if sum_bef <= power and power <= sum_bef+bw/2: | |
print('IRON MAN') | |
else: | |
print('CAPTAIN AMERICA') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment