#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
using namespace std;
long long a,b,c,d,t,cnt,e;
int main() {
    cin >> t;
    for (int i = 1; i <= t; i++) {
        cin >> a >> b >> c;
        cnt = 0;
        if (a >= c) {
            for (int j = 1; j <= b + 1; j++) {
                if (a - c >= 0) {
                    cnt = cnt + 1;
                    a = a - c;
                }
            }
            for (int j = cnt; j >= 1; j--) {
                e = e + j;
            }
            if (b >= e * c + a * (e + 1)) {
                cout << "Tak" << endl;
            }
            else cout << "Nei" << endl;


        }
        else cout << "Nie" << endl;
    }
    return 0;
}