#include <iostream>
using namespace std;
typedef unsigned long long ull;
long long tab[100];
void generuj()
{
ull a=0,b=1;
for(int i=0;i<45;i++)
{
tab[i]=b;
b+=a;
a=b-a;
}
}
int main()
{
ios_base::sync_with_stdio(0);
generuj();
int t;
cin>>t;
for(int i=0;i<t;i++)
{
ull x;
cin>>x;
if(x==0) cout<<"TAK"<<endl;
else
{
bool c=false;
for(int j=0;j<45;j++)
{
for(int k=j;k<45;k++)
{
if(tab[j]*tab[k]==x)
{
c=true;
break;
}
}
}
if(c) cout<<"TAK"<<endl;
else cout<<"NIE"<<endl;
}
}
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #include <iostream> using namespace std; typedef unsigned long long ull; long long tab[100]; void generuj() { ull a=0,b=1; for(int i=0;i<45;i++) { tab[i]=b; b+=a; a=b-a; } } int main() { ios_base::sync_with_stdio(0); generuj(); int t; cin>>t; for(int i=0;i<t;i++) { ull x; cin>>x; if(x==0) cout<<"TAK"<<endl; else { bool c=false; for(int j=0;j<45;j++) { for(int k=j;k<45;k++) { if(tab[j]*tab[k]==x) { c=true; break; } } } if(c) cout<<"TAK"<<endl; else cout<<"NIE"<<endl; } } } |
English