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

ll gaus(ll n, ll k){
    return (n % k) * (n / k + 1) * (n / k + 2) / 2 + (k - n % k) * (n / k) * (n / k + 1) / 2;
}

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

    if(gaus(n, k) <= m) cout << "Tak\n";
    else cout << "Nie\n";
}

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

        int t;

        cin >> t;

        while(t--){
            solve();
        }
        return 0;
}