#include <iostream>
int f(int a) {
	int s = 0;
	while (a > 0) s += a--;
	return s;
}
int main() {
	int t;
	std::cin >> t;
	for (int x = 0; x < t; x++) {
		int g, d, b;
		std::cin >> d >> b >> g;
		std::cout<<(b >= (g*f(d/g) + d%g*(d/g+1))?"Tak":"Nie")<<"\n";
	}
}