#include<bits/stdc++.h>

using namespace std;
int t;
int u, b, g;
int main(){
int s = 0;
int p = 0;
int x;
        cin >> t;
    for(int i = 1; i<=t; i++){
    cin >> u >> b >> g;
int s1 = u/g;
 int os = u%g;
            int z = (u-os) / g;
    for(int j = 1; j <= s1; j++){
                     s +=j;
    }

    for(int k = 1;k <= z; k++){
                    p +=k;

    }
    for(int l = 1;l <= os; l++){
                    x = (s1 + 1) * os;
    }
int y = x + (g * p);
//cout << y << endl;
    int p4 = y;
    int s4 = s;
    p = 0;
    s = 0;
    if(u%g == 0){
        int s2 = s4 * g;
            if(b >= s2){
                cout << "Tak" << endl;
            }
    }
    if(u%g == 0){
        int s3 = s4 * g;
            if(b < s3){
                cout << "Nie" << endl;
            }
    }
    if(u%g != 0){
        if(b >= y){
            cout << "Tak" << endl;
        }
    }

    if(u%g != 0){
        if(b < y){
            cout << "Nie" << endl;
        }
    }


    }


return 0;
}