#include<cstdio>
#include<iostream>
using namespace std;
long long int F[55];
long long int testy, n, ok;
int main()
{
ios_base::sync_with_stdio(0);
F[0]=0;
F[1]=1;
for(int i=2; i<=50; i++)
{
F[i]=F[i-1]+F[i-2];
}
cin >> testy;
while(testy--)
{
cin >> n;
ok=0;
for(int i=0; i<=44; i++)
{
for(int j=0; j<=44; j++)
{
if(F[i]*F[j]==n) ok=5;
}
}
if(ok==5) cout << "TAK\n";
else cout << "NIE\n";
}
return 0;
}
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 | #include<cstdio> #include<iostream> using namespace std; long long int F[55]; long long int testy, n, ok; int main() { ios_base::sync_with_stdio(0); F[0]=0; F[1]=1; for(int i=2; i<=50; i++) { F[i]=F[i-1]+F[i-2]; } cin >> testy; while(testy--) { cin >> n; ok=0; for(int i=0; i<=44; i++) { for(int j=0; j<=44; j++) { if(F[i]*F[j]==n) ok=5; } } if(ok==5) cout << "TAK\n"; else cout << "NIE\n"; } return 0; } |
English