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

ll n,m,k;

void solve(){
    cin >> n >> m >> k;

    if(n%k == 0){
        ll d = n/k;
        ll s = (n*(d+1))/2;
        cout << (m >= s ? "Tak" : "Nie") << endl;
        return;
    }

    ll x = n%k;
    ll d = n/k;
    ll n1 = n-x;
    ll s = (n1*(d+1))/2;

    ll dod = (d+1)*x;
    s += dod;

    cout << (m >= s ? "Tak" : "Nie") << endl;
}

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