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

namespace Zadatak_2
{
    class Program
    {
        struct Test
        {
            public long N;
            public long M;
            public long K;
        }
        static bool DovoljnoBananica(Test a)
        {
            long[] x = new long[a.N];
            long y = a.K;
            long z = a.N;
            long zbir = 0;
            int brojac = 1;
            if (y == 1)
            {
                for (int i = 0; i <= a.N; i++)
                {
                    zbir += i;
                }
            }
            else
            {
                while (z != 0)
                {
                    if (x[brojac] < y)
                    {
                        x[brojac]++;
                        z--;
                    }
                    else
                    {
                        brojac++;
                    }
                }
            }
            for (int i = 0; i < a.N; i++)
            {
                zbir += i * x[i];
            }
            if (zbir <= a.M)
                return true;
            else
                return false;
        }
        static void Main(string[] args)
        {
            int T = int.Parse(Console.ReadLine());
            Test[] a = new Test[T];
            
            for (int i = 0; i < T; i++)
            {
                string[] s = Console.ReadLine().Split();
                a[i].N = long.Parse(s[0]);
                a[i].M = long.Parse(s[1]);
                a[i].K = long.Parse(s[2]);
            }

            for (int i = 0; i < T; i++)
            {
                if (a[i].N >= a[i].K == true && DovoljnoBananica(a[i]) == true)
                {
                    Console.WriteLine("Tak");
                }
                else
                {
                    Console.WriteLine("Nie");
                }
            }
        }
    }
}