program ekskurzija;
var t,i:integer;
n,k,f:array[1..11] of longint;
m:array[1..11] of int64;

begin
read(t);
for i:=1 to t do
begin
read(n[i],m[i],k[i]);
if (k[i]*(n[i] div k[i])*(n[i] div k[i] + 1)/2 + (n[i] mod k[i])*(n[i] div k[i] + 1))<=m[i] then f[i]:=1
else f[i]:=2;
end;
for i:=1 to t do
if f[i]=2 then writeln('Nie') else writeln('Tak');
end.