#include<iostream>
using namespace std;
struct test
{
    long long m, n, k;
};
void unos(test x[], int t)
{
for(int i=0; i<t; i++)
       cin>>x[i].n>>x[i].m>>x[i].k;
}
bool prov(test x[], int i)
{
    int u=x[i].n, ch=x[i].m, gr = x[i].k;
    int br1 = u / gr;
    int br2 = u % gr;
    int br3 = br1+1;
    return((u-br2)*br1*(br1+1)/2+br2*(br3+1)*br3/2<=ch);
}
int main()
{
    int t;
    cin>>t;
    test x[t];
    unos(x, t);
    for(int i=0; i<t; i++)
        if(prov(x, i))cout<<"Tak"<<endl; else cout<<"Nie";
}