using System;
using System.Collections.Generic;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            List<string> li = new List<string>();
            for (int i = 0; i < t; i++)
            {
                String[] o = Console.ReadLine().Split();
                int n = Convert.ToInt32(o[0]);
                long m = long.Parse(o[1]);
                int k = Convert.ToInt32(o[2]);
                int br = 0;
                int banana = 1;
                while (n >= k)
                {
                    br += banana * k;
                    n -= k;
                    banana++;
                }
                if (n > 0)
                    br += banana * n;
                if (br <= m)
                    li.Add("Tak");
                else
                    li.Add("Nie");
            }
            foreach (string p in li)
                Console.WriteLine(p);
        }
    }
}