#include <bits/stdc++.h>
using namespace std;

#define ll long long
const ll N = 200001;
const ll inf = 1e9 + 7;
ll a[N], b[N];

void solve() {
    ll n, m, k;
    cin >> n >> m >> k;
    ll x1 = n / k, x2 = n % k;
    ll resenje = x1 * (x1 + 1) / 2;
    resenje *= k;
    resenje += (x1 + 1) * x2;
    if (resenje > m) {
        cout << "Nie" << endl;
        return;
    }
    cout << "Tak" << endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--)
    solve();
    return 0;
}