fork(3) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int n, t, m;
  6.  
  7. int main()
  8. {
  9. cin>>n;
  10.  
  11. for(int j=0;j<n;j++)
  12. {
  13. cin>>t;
  14. if (t==2)
  15. {
  16. cout<<"TAK";
  17. }
  18. else if (t<2)
  19. {
  20. cout<<"NIE";
  21. }
  22. else
  23. {
  24. m=t-1;
  25. while (t%m!=0)
  26. {
  27. t%m;
  28. m=m-1;
  29. }
  30. if (m==1)
  31. cout<<"TAK";
  32. else
  33. cout<<"NIE";
  34. }
  35. }
  36.  
  37.  
  38.  
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty