#include <iostream>
using namespace std;
int main() {
  short int t;
  unsigned long int n,k,s=0;
  unsigned long long int m,bruug,bruug2;
  cin>>t;
  for(int i=0;i<t;i++){
    cin>>n>>m>>k;
    bruug=n/k;
    bruug2=n%k;
    s=(n/bruug)*(bruug+1)*bruug/2+(bruug2+1)*bruug2/2;
    if(s<=m){
      cout<<"Tak"<<'\n';
    }
    else{
      cout<<"Nie"<<'\n';
    }
  }
}