Skip to content

Instantly share code, notes, and snippets.

@anmolj7
Created January 18, 2020 14:29
Show Gist options
  • Save anmolj7/57e113daffc4742ab154c6ab6537a04e to your computer and use it in GitHub Desktop.
Save anmolj7/57e113daffc4742ab154c6ab6537a04e to your computer and use it in GitHub Desktop.
#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