#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int t, u, k, g, br1, br2;

    cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> u >> k >> g;

		br1 = u / g;
		br2 = u % g;

		if (k >= ((g * br1 * (br1 - 1) / 2)+g*br2*(br1+1)))
		{
			cout << "Tak" << endl;
		}
		else
		{
			cout << "Nie"<<endl;
		}
	}
}