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

int sigma (long long int bupg)
{
	
	int mnozilac = bupg/2;
	
	int osnova = bupg + bupg % 2;
	
	return osnova * mnozilac + bupg/2+bupg%2;
}

int amogus (long long int ucenici, long long int krem, long long int grupa)
{
	long long int mod;
	mod = ucenici % grupa;
	long long int minimum;
	long long int upg = ucenici/grupa;
	long long int sigmaa = sigma (upg);
	
	if (mod == 0)
	{
		minimum = grupa * sigmaa;
	} else {
		minimum = mod * (sigmaa + upg + 1) + (grupa - mod) * sigmaa;
	}
	
	
	
	if (minimum < krem)
	{
		return 1;
	} else 
	{
		return 0;
	}
	
}


int main(int argc, char** argv) {
	int t;
	cin>>t;
    int resenja [t];
	long long int u,k,g;
	for(int i=0; i<t; ++i)
	{
		cin>>u>>k>>g;
		resenja[i] = amogus(u,k,g);
	}
	for(int i=0; i<t; ++i)
	{
		if(resenja[i]==1)
		{
			cout<<"Tak"<<endl;
		} else {
			cout<<"Nie"<<endl;
		}
		
	}
}