#include <bits/stdc++.h>

using namespace std;

long long t, m, n, k;

void solve()
{
    cin >> n >> m >> k;
    if (k > n || m < n)
    {
        cout << "Nie" << endl;
    }
    long long p = n % k;
    long long q = k - p;
    long long r = n / k;
    long long minimum = (p * ((r + 1) * (r + 2)) / 2) + (q * ((r + 1) * r) / 2);
    if (minimum < m)
        cout << "Tak" << endl;
    else
        cout << "Nie" << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> t;
    for (long long i = 0; i < t; i++)
    {
        solve();
    }
    return 0;
}