#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	long long t,n,m,k,p,kon=0;
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>n>>m>>k;
		if(n%k==0){
			p=n/k;
			kon=k*(p*(p+1)/2);
		}
		else{
			p=n/k;
			kon=k*(p*(p+1)/2) + (n%k)*(p+1);
		}
		if(kon<=m){
			cout<<"Tak"<<endl;
		}
		else{
			cout<<"Nie"<<endl;
		}
	}
	return 0;
}