using System;

namespace TakmicenjeB
{
    internal class Program
    {
        public struct T
        {
            public int N;
            public int M;
            public int K;

            public T(int _n, int _m, int _k)
            {
                N = _n; M = _m; K = _k;
            }
        }
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            T[] niz = new T[t];

            string[] input;
            for(int i = 0; i < t; i++)
            {
                input = Console.ReadLine().Split();
                niz[i] = new T(int.Parse(input[0]), int.Parse(input[1]), int.Parse(input[2]));
		    }

            foreach (T a in niz)
            {
				int s = a.N / a.K;
                if (a.K > a.N) 
                {
                    Console.WriteLine("Nie"); continue; 
			    }
				else if(a.K*((s*s+s)/2)+(a.N % a.K) * (s + 1) <= a.M)
				{
                    Console.WriteLine("Tak");
					continue;
				}
				else Console.WriteLine("Nie");
			}
		}
	}
}