#include <iostream>

using namespace std;

int main()
{
    long long t, n, m, k;
    cin >> t;

    for(int i = 0; i < t; i++) {
        cin >> n >> m >> k;
        int br = 1;

        while(n > 0) {
            if(k > n)
                m -= n * br;

            else
                m -= k * br;

            br ++;
            n -= k;
        }

        if(m >= 0)
            cout << "Tak" << endl;
        else
            cout << "Nie" << endl;
    }

    return 0;
}