using System;

namespace ConsoleApp13
{
    class Program
    {
        static void Main(string[] args)
        {
            var t = Int32.Parse(Console.ReadLine());
            int[,] a = new int[t, 3];
            for (int i = 0; i < t; i++)
            {
                var b = Console.ReadLine().Split(' ');
                a[i, 0] = Int32.Parse(b[0]);
                a[i, 1] = Int32.Parse(b[1]);
                a[i, 2] = Int32.Parse(b[2]);
            }
            for (int i = 0; i < t; i++)
            {
                int p = a[i, 0] / a[i, 2];
                int p1 = a[i, 0] - (a[i, 2] * p);
                int k, k1;
                if (p % 2 == 0)
                {
                    k = (p + 1) * (p / 2);
                }
                else
                {
                    k = (p * ((p - 1) / 2)) + p;
                }
                if (p1 % 2 == 0)
                {
                    k1 = (p1 + 1) * (p1 / 2);
                }
                else
                {
                    k1 = (p1 * ((p1 - 1) / 2)) + p1;
                }
                if (a[i, 1] >= (a[i, 2] * k) + k1)
                {
                    Console.WriteLine("Tak");
                }
                else
                {
                    Console.WriteLine("Nie");
                }
            }
        }
    }
}