#include<iostream>
#define ll long long

using namespace std;

void FICA()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
   int t;

   cin>>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;
            
        }


   }

}

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