#include <bits/stdc++.h>
using namespace std;

int main()
{
ios_base::sync_with_stdio(false) ;
	cin.tie(0);
	cout.tie(0);
int T;
cin >>T;
int i=0;
unsigned long long N[11];
unsigned long long M[11];
unsigned long long K[11];
for(i=0;i<T;i++)
{
	cin>>N[i];
	cin>>M[i];
	cin>>K[i];	
}	
for(i=0;i<T;i++)
{
	 
     { unsigned long long l=0;
       unsigned long long p=0;
       unsigned long long q=0;
       unsigned long long x=0;
       unsigned long long m=0;
       unsigned long long z=1;
       int c=0;
       m=M[i];
	   p=N[i]; 
       l=K[i];
       q=p%l;
       x=(p-q)/l;
       
       for(z=1;z<=x;z++)
       {
       	if(m>=z*l)
       		m-=z*l;
       	else{
       		c=1;
		    cout<<"Nie"<<endl;
		}
	   }
       if(m>=q*z&&c==0)
       cout<<"Tak"<<endl;
       else if(c==0) cout<<"Nie"<<endl;
       
	 }

}	
return 0;	
}