fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int x,y,z;
  8. cin>>z;
  9. for(int i=0; i<z; i++)
  10. {
  11. cin>>x>>y;
  12. if(y>=(x-1))
  13. {
  14. if(y==0)
  15. cout<<"NIE"<<endl;
  16. else if ((x-1)==0||x==0)
  17. cout<<"TAK"<<endl;
  18. else if((x-1)%y==0)
  19. cout<<"NIE"<<endl;
  20. else
  21. cout<<"TAK"<<endl;
  22. }
  23. else cout<<"TAK"<<endl;
  24.  
  25.  
  26.  
  27. }
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 3464KB
stdin
2
3 2
55 22
stdout
NIE
TAK