#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main()
{
    int x, y, t, n;
    cin>>n;
    vector<string> a1;
    for(int i = 0; i < n; i++){
        cin>>y>>t>>x;
        if(x * (y / x) * (y / x + 1) / 2 + (y % x) * (y / x + 1) <= t){
            a1.push_back("Tak");

        }else{
            a1.push_back("Nie");
        }
    }
    for(int i = 0; i < n; i++){
        cout<<a1[i]<<endl;
    }
    return 0;
}