using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ekskurzija
{
    internal class Program
    {

        static long Zbir(long a)
        {
            long zbir = 0;
            for (long i = 1; i < a + 1; i++)
            {
                zbir += i;
            }
            return zbir;
        }

        static void Main(string[] args)
        {
           
            int t = int.Parse(Console.ReadLine());
            string[] vs = new string[t];
            for (int i = 0; i < t; i++)
            {

                string[] s = Console.ReadLine().Split();
                long n = long.Parse(s[0]);
                long m = long.Parse(s[1]);
                long k = long.Parse(s[2]);

                n = n - k + 1;
                if (m - Zbir(n) > 0) vs[i] = "Tak";
                else vs[i] = "Nie";
            }
            for (int i = 0; i < t; i++)
            {
                Console.WriteLine(vs[i]);
            }

        }
    }
}