#include<iostream>
#define ll long long

using namespace std;

void FICA()
{
   int t;

   cin>>t;

  // bool niz[t];

   ll n,m,k;

   while(t--){

    cin>>n>>m>>k;

        ll ostatak = n % k;
        ll br = n / k;

        if((((br*(br+1))/2) * k + (br+1) * ostatak) > m){

            cout<<"Nie"<<endl;

        }else{

            cout<<"Tak"<<endl;

          /*  if((((br*(br+1))/2) * k + (br+1) * ostatak) == m)
            cout<<"Tak"<<endl;
            else

            if((m - (((br*(br+1))/2) * k + (br+1) * ostatak) + br) <= (br-1)){
                cout<<"Nie"<<endl;
            }else{
                cout<<"Tak"<<endl;
            } */


        }


   }

   /*for(int i:niz){
    if(i) cout<<"Nie"<<endl;
    else cout<<"Tak"<<endl;
   }*/

}

int main(void)
{
    FICA();
    return 0;
}