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

#define endl '\n'
#define ll long long
#define NMAX (int)1e6
#define vi vector<int>
#define pii pair<int,int>
#define w(x) cout<<#x<<':'<<x<<endl;
#define PB push_back
#define juseinbolt ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

bool solve(int n, ll m, int k)
{
    ll x=n/k;
    ll smin=x*(x+1)/2*1ll*k+(x+1)*1ll*(n%k);
    //cout<<smin;
    if(smin>m) return false;
    else return true;
}

int main()
{
    juseinbolt;

    int t,n,k;
    ll m;
    cin>>t;
    while(t--)
    {
        cin>>n>>m>>k;
        if(solve(n,m,k)) cout<<"Tak"<<endl;
        else cout<<"Nie"<<endl;
    }
    return 0;
}