using System;

namespace Z2_Ekskurzija
{
    class Program
    {
        static bool Test(int a, int b, int c)
        {
            int o, p, k1, k2; 
            double x, y1, y2, v1, v2;
            o = a / c;
            p = a % c;
            v1 = o + 1;
            v2 = o + 2;
            k1 = c - p;
            k2 = p;
            y1 = v1 / 2;
            y2 = v2 / 2;
            x = (y1 * o * k1) + (y2 * v1 * k2);
            if (x <= b)
            {
                return true;
            }
            else
            {
                return false;
            }   
        }
        static void Main(string[] args)
        {
            int i, a=0, b=0, c=0;
            int t = Convert.ToInt32(Console.ReadLine());
            int[] n = new int[t];
            int[] m = new int[t];
            int[] k = new int[t];
            for (i = 0; i < t; i++)
            {
                string[] s = Console.ReadLine().Split();
                n[i] = int.Parse(s[0]);
                m[i] = int.Parse(s[1]);
                k[i] = int.Parse(s[2]);
            }
            for (i = 0; i < t; i++)
            {
                a = n[i];
                b = m[i];
                c = k[i];
                if(Test(a, b, c))
                {
                    Console.WriteLine("Tak");
                }
                else
                {
                    Console.WriteLine("Nie");
                }
            }
        }
    }
}