#include<bits/stdc++.h>

using namespace std;

long long gaus(long long n){
    return (n * (n + 1)) / 2;
}

void solve(){
    long long n, m, k;
    cin >> n >> m >> k;
    long long brgv, brgm;
    brgv = n / k + 1;
    brgm = n / k;
    if(gaus(brgv) * (n % k) + gaus(brgm) * (n - n % k) <= m){
        cout << "Tak\n";
    }
    else cout << "Nie\n";
    return;
}

int main(){

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