#include<iostream>
using namespace std;
int main()
{
    int t, rez, ost, zbir;
    cin >> t;
    int a[t][3];
    for(int i = 0; i<t; i++)
        cin >> a[i][0] >> a[i][1] >> a[i][2];

    for(int i = 0; i<t; i++)
    {
        rez = a[i][0] / a[i][2];
        ost = a[i][0] % a[i][2];
        zbir = (a[i][2]-1)*(rez*(rez+1)/2) + ost*((rez+ost)*(rez+ost+1)/2);
        if(zbir<=a[i][1] && zbir!=0)
            cout << "Tak" << endl;
        else cout << "Nis" << endl;
    }
    return 0;
}