#include <iostream>

using namespace std;

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