#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 (int bupg)
{
	
	int mnozilac = bupg/2;
	
	int osnova = bupg + bupg % 2;
	
	return osnova * mnozilac + bupg/2+bupg%2;
}

void amogus (int ucenici, int krem, int grupa)
{
	int mod;
	mod = ucenici % grupa;
	int minimum;
	int upg = ucenici/grupa;
	int sigmaa = sigma (upg);
	
	if (mod == 0)
	{
		minimum = grupa * sigmaa;
	} else {
		minimum = mod * (sigmaa + upg + 1) + (grupa - mod) * sigmaa;
	}
	
	
	
	if (minimum < krem)
	{
		cout<<"Tak";
	} else 
	{
		cout<<"Nie";
	}
	
}


int main(int argc, char** argv) {
	int t;
	cin>>t;
	int u,k,g;
	for(int i=0; i<t; ++i)
	{
		cin>>u>>k>>g;
		amogus(u,k,g);
	}
}