#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n; cin >> n;
    long long rez = 0;

    for(long long i = 0; i < n; i ++)
    {
        long long bruc; cin >> bruc;
        long long m; cin >> m;
        long long k; cin >> k;

        if(k == 1)
        {
            cout << "Nie";
            break;
        }
        if(k > bruc)
        {
            cout << "Nie";
            break;
        }
        for(long long j = 1; j <= k; j ++)
        {
            rez +=j;
        }
        if(rez > m)
        {
            cout << "Nie";
            break;
        }
        cout << "Tak" << endl;
    }
    return 0;
}