#include <bits/stdc++.h>
using namespace std;
long long m,t,n,k,brojRazlicitih,triangleInt;
float triangle;
int main(){
    cin >> t;
    while(t--){
        cin >> n >> m >> k;
        brojRazlicitih=n/k+n%k;
        triangle=0.5*brojRazlicitih*(brojRazlicitih+1);
        triangleInt=(long long)triangle;
        if(floor(m/k)>=triangleInt)cout << "Tak" << endl;
        else cout << "Nie" << endl;
    }
    return 0;
}