Created
January 18, 2020 14:29
-
-
Save anmolj7/57e113daffc4742ab154c6ab6537a04e 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
#include "bits/stdc++.h" | |
using namespace std; | |
typedef unsigned long long ull; | |
typedef long long ll; | |
int main(){ | |
ios_base::sync_with_stdio(0); | |
cin.tie(nullptr); | |
ll n; | |
cin>>n; | |
while(n--) | |
{ | |
double power; | |
double k; | |
cin>>power; | |
k=(-1+sqrt(1+2*power))/2; | |
if(k==floor(k)) | |
k--; | |
k=floor(k); | |
ll sumbef=(k*(4+4*k))/2; | |
ll bw=4+(k)*4; | |
if(sumbef<=power&&power<=sumbef+bw/2) | |
cout<<"IRON MAN"; | |
else | |
cout<<"CAPTAIN AMERICA"; | |
cout<<"\n"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment