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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1");
                    return;
                }
            }

            counter--;
            result = radiusMass[counter];
            Console.Write(result);

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            Console.WriteLine(result);

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            //Console.WriteLine(result);
            //Console.WriteLine(String.Format("{0:F9}", result));
            Console.WriteLine("{0:R}", result);

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                //Console.WriteLine(counter + " " + s);
                counter++;
                if ((counter == n) && (s < 1000000))
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            //Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            counter--;
            //result = Math.Round(radiusMass[counter],9);
            result = radiusMass[counter];
            //Console.WriteLine(result);
            //Console.WriteLine(String.Format("{0:F9}", result));
            //string res = result.ToString();
            //Console.WriteLine("{0:R}", res);
            //Console.WriteLine(String.Format("{0:R}", result).Replace(',', '.'));
            //result.ToString(CultureInfo.InvariantCulture);
            Console.WriteLine(result.ToString(CultureInfo.InvariantCulture));
            Console.Out.Flush();

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            Console.Write(result + "\n");

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                //Console.WriteLine(counter + " " + s);
                counter++;
                if ((counter == n) && (s < 1000000))
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            //Console.WriteLine(result);
            //Console.WriteLine(String.Format("{0:F9}", result));
            //string res = result.ToString();
            //Console.WriteLine("{0:R}", res);
            Console.WriteLine(String.Format("{0:R}", result).Replace(',', '.'));
            Console.Out.Flush();

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            //Console.WriteLine(result);
            //Console.WriteLine(String.Format("{0:F9}", result));
            //string res = result.ToString();
            //Console.WriteLine("{0:R}", res);
            Console.WriteLine(String.Format("{0:R}", result).Replace(',', '.'));
            Console.Out.Flush();

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],7);
            Console.Write(result + " ");

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],7);
            Console.Write(result);

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            //Console.WriteLine(result);
            Console.WriteLine(String.Format("{0:F9}", result));

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            //result = Math.Round(radiusMass[counter],7);
            result = radiusMass[counter];
            Console.Write(result + " ");

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            Console.Write(result + " ");

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                //Console.WriteLine(counter + " " + s);
                counter++;
                if ((counter == n) && (s < 1000000))
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            //Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            //Console.WriteLine(result);
            //Console.WriteLine(String.Format("{0:F9}", result));
            //string res = result.ToString();
            //Console.WriteLine("{0:R}", res);
            //Console.WriteLine(String.Format("{0:R}", result).Replace(',', '.'));
            //result.ToString(CultureInfo.InvariantCulture);
            Console.WriteLine(result.ToString(CultureInfo.InvariantCulture));
            Console.Out.Flush();

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                //Console.WriteLine(counter + " " + s);
                counter++;
                if ((counter == n) && (s < 1000000))
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            Console.WriteLine(result);
            //Console.WriteLine(String.Format("{0:F9}", result));
            //string res = result.ToString();
            //Console.WriteLine("{0:R}", res);
            //Console.WriteLine(String.Format("{0:R}", result).Replace(',', '.'));
            Console.Out.Flush();

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace _415
{
    class B
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                //s = @"5 5 5 4 3 2 1".Split(cs, StringSplitOptions.RemoveEmptyEntries);
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }
        }

        static void Main(string[] args)
        {
            var stream = new Scanner();
            int n = stream.nextInt(); // number of villages
            int s = stream.nextInt(); // population on Tomsk

            int x, y;
            double r;
            double[] radiusMass = new double[n];
            int[] inputMass = new int[n];

            for (int i = 0; i < n; i++)
            {
                x = stream.nextInt();
                y = stream.nextInt();
                r = Math.Sqrt(x * x + y * y);
                radiusMass[i] = r;
                inputMass[i] = stream.nextInt();
            }

            double locVar = 0;
            int locVar2 = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n-1; j++)
                {
                    if (radiusMass[j] > radiusMass[j + 1])
                    {
                        locVar = radiusMass[j];
                        radiusMass[j] = radiusMass[j + 1];
                        radiusMass[j + 1] = locVar;

                        locVar2 = inputMass[j];
                        inputMass[j] = inputMass[j + 1];
                        inputMass[j + 1] = locVar2;
                    }
                }

            int population = s;
            int counter = 0;
            double result = -1;
            while (s < 1000000)
            {
                s = s + inputMass[counter];
                counter++;
                if (counter == n)
                {
                    Console.Write("-1 ");
                    return;
                }
            }

            counter--;
            result = Math.Round(radiusMass[counter],9);
            //result = radiusMass[counter];
            //Console.WriteLine(result);
            //Console.WriteLine(String.Format("{0:F9}", result));
            Console.WriteLine("{0:R}", result);
            Console.Out.Flush();

            //Console.Write(resultMass[i] + " ");
        }
    }
}


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

namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int n = int.Parse(input[0]),
                s = int.Parse(input[1]);

            int[] pop = new int[n];

            double[] rs = new double[n];

            for (int i = 0; i < n; i++)
            {
                input = Console.ReadLine().Split();
                rs[i] = Math.Pow(int.Parse(input[0]), 2) + Math.Pow(int.Parse(input[1]), 2);
                pop[i] = int.Parse(input[2]);
            }

            Array.Sort(rs, pop);

            double r = 0;
            int j = 0;

            while (s < 1000000 && j < n)
            {
                s += pop[j];
                r = rs[j];
                j++;
            }

            float m = (float)Math.Sqrt(r);

            Console.WriteLine(m);
        }

    }

}


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

namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int n = int.Parse(input[0]),
                s = int.Parse(input[1]);

            int[] pop = new int[n];

            double[] rs = new double[n];

            for (int i = 0; i < n; i++)
            {
                input = Console.ReadLine().Split();
                rs[i] = Math.Pow(int.Parse(input[0]), 2) + Math.Pow(int.Parse(input[1]), 2);
                pop[i] = int.Parse(input[2]);
            }

            Array.Sort(rs, pop);

            double r = 0;
            int j = 0;

            while (s < 1000000 && j < n)
            {
                s += pop[j];
                r = rs[j];
                j++;
            }

            Console.WriteLine(Math.Sqrt(r));
            Console.ReadLine();
        }

    }

}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int N;
	cin>>N;
	for (int i=0;i<N;i++){
		int a,b;
		cin >> a>>b;
		int d=sqrt(b),yes=0;
	//	printf ("d is %d\n",d);
		for (int i=d,j=0;j<1e8;j++){
			if (i+j<0) ;
			else {
				if (a>=i+j+b/(i+j+1)+b%(i+j+1)>0?1:0){
					yes=1;break;
				}
			}
			if (i-j<0) ;
			else {
			if (a>=i-j+b/(i-j+1)+b%(i-j+1)>0?1:0) {
				yes=1;break;
			}
			}
		}
		if (yes) printf ("YES\n");
		else printf ("NO\n");
	}
}


#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int T;
    long int a;
    int n,d;
    cin>>T;
    for(int i=0;i<T;i++){
        cin>>n>>d;
        int c=0;
        for(int x=0;x<=n;x++){
            a=x+(d+x)/(x+1);
            if(a<=n)
                c++;
            if(c==1)
                break;
        }
        if(c>0)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;

    }
}


#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int T,a;
    float n,d;
    cin>>T;
    for(int i=0;i<T;i++){
        cin>>n>>d;
        int c=0;
        for(int x=0;x<=n;x++){
            a=x+ceil(d/(x+1));
            if(a<=n)
                c++;
            if(c==1)
                break;
        }
        if(c>0)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;

    }
}


#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int T;
    float n,d;
    cin>>T;
    for(int i=0;i<T;i++){
        cin>>n>>d;
        int c=0;
        for(int x=0;x<=n;x++){
            int m=ceil(d/(x+1));
            int a=x+m;
            if(a<=n)
                c++;
        }
        if(c>0)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;

    }
}


#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int T;
    long int a;
    float n,d;
    cin>>T;
    for(int i=0;i<T;i++){
        cin>>n>>d;
        int c=0;
        for(int x=0;x<=n;x++){
            a=x+ceil(d/(x+1));
            if(a<=n)
                c++;
            if(c==1)
                break;
        }
        if(c>0)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;

    }
}


#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int T;
    float n,d;
    cin>>T;
    for(int i=0;i<T;i++){
        cin>>n>>d;
        int c=0;
        for(int x=0;x<=n;x++){
            int m=ceil(d/(x+1));
            int a=x+m;
            if(a<=n)
                c++;
        }
        if(c>0)
            cout<<"YES";
        else
            cout<<"NO";

    }
}


#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int T,a,c;
    float n,d;
    cin>>T;
    for(int i=0;i<T;i++){
        cin>>n>>d;
        c=0;
        for(int x=0;x<=n;x++){
            a=x+ceil(d/(x+1));;
            if(a<=n)
                c++;
        }
        if(c>0)
            cout<<"YES";
        else
            cout<<"NO";

    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        int ans=(n-1)*(n-1)-4*(d-n);
        if(ans<0) cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        if(d>n) cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--) {
     int n,i,d;
     cin>>n>>d;

     if(n>=d) {
       cout<<"YES"<<endl;
       continue;
     }

     long long ans=(n-1)*(n-1)-(4*(d-n));
     if(ans>=0) cout<<"YES"<<endl;
     else cout<<"NO"<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--) {
     int n,i,d;
     cin>>n>>d;

     if(n>=d) {
       cout<<"YES"<<endl;
       continue;
     }

     int ans=(n-1)*(n-1)-(4*(d-n));
     if(ans>=0) cout<<"YES"<<endl;
     else cout<<"NO"<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--) {
     int n,i,d;
     cin>>n>>d;
     bool flag=false;
     for(i=0; i<=n; i++) {
        int ans=i+ceil(d/(float)i+1);
        if(ans<=n) {
          flag=true;
        }
     }
     if(flag) cout<<"YES"<<endl;
     else cout<<"NO"<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--) {
     long long n,i,d;
     cin>>n>>d;

     if(n>=d) {
       cout<<"YES"<<endl;
       continue;
     }

     long long ans=(n-1)*(n-1)-(4*(d-n));
     if(ans>=0) cout<<"YES"<<endl;
     else cout<<"NO"<<endl;
  }
  return 0;
}


/******************************

    @author:  AbOoOd
    @title:   ACM - CF - I_N_Y_Bs
    @date:    Everyday

*******************************/
#include<bits/stdc++.h>
#define all(x) (x.begin()) , (x.end())
#define rep(i, start, end) for(int i = start; i < end; ++i)
using namespace std ;
typedef long long ll ;
const double PI = 3.14159265358979323846 ;
bool isOdd(int n) { return n%2 != 0 ; }
bool isEven(int n) { return n%2 == 0; }
int main ()
{
 ///                     ▌│█║▌║▌║ AbOoOd ║▌║▌║█│▌
 ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL) ;
 ll t , n , d , x = 1 , j = 0 ;
 cin >> t ;
 while ( t -- )
 {
     j = 0 ;
     cin >> n >> d ;
     if ( d <= n ) {
        cout << "YES" << endl ;
     }
     else {
        x = d - n ;
        j = x + ceil( d/(x+1) ) ;
        if ( j > n )
            cout << "NO" << endl ;
        else
            cout << "YES" << endl ;
     }
 }
 return 0 ;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std ;
int main()
{
  double n , d , t ;
  cin >> t ;
  while( t -- )
  {
    cin >> n >> d ;
    if( n >= d || d / n <= 1 )
      cout << "YES\n" ;
    else
      cout << "NO\n" ;
  }
  return 0 ;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std ;
int main()
{
  double n , d , t ;
  cin >> t ;
  while( t -- )
  {
    cin >> n >> d ;
    if( n >= d || n+n/2<=d )
      cout << "YES\n" ;
    else
      cout << "NO\n" ;
  }
  return 0 ;
}


/******************************

    @author:  AbOoOd
    @title:   ACM - CF - I_N_Y_Bs
    @date:    Everyday

*******************************/
#include<bits/stdc++.h>
#define all(x) (x.begin()) , (x.end())
#define rep(i, start, end) for(int i = start; i < end; ++i)
using namespace std ;
typedef long long ll ;
const double PI = 3.14159265358979323846 ;
bool isOdd(int n) { return n%2 != 0 ; }
bool isEven(int n) { return n%2 == 0; }
int main ()
{
 ///                     ▌│█║▌║▌║ AbOoOd ║▌║▌║█│▌
 ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL) ;
 ll t , n , d , x = 1 , j = 0 ;
 cin >> t ;
 while ( t -- )
 {
     j = 0 ;
     cin >> n >> d ;
     if ( d <= n ) {
        cout << "YES" << endl ;
     }
     else {
        j = x + ceil( d/(x+1) ) ;
        if ( j > n )
            cout << "NO" << endl ;
        else cout << "YES" << endl ;
     }
 }
 return 0 ;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std ;
int main()
{
  double n , d , t ;
  cin >> t ;
  while( t -- )
  {
    cin >> n >> d ;
    double x = n/2 ;
    if( n >= d || ceil(d/(x+1)+x) <= n || ceil(d/(x)+x-1) <= n || ceil(d/(x+2)+x+1) <= n )
      cout << "YES\n" ;
    else
      cout << "NO\n" ;
  }
  return 0 ;
}


/******************************

    @author:  AbOoOd
    @title:   ACM - CF - I_N_Y_Bs
    @date:    Everyday

*******************************/
#include<bits/stdc++.h>
#define all(x) (x.begin()) , (x.end())
#define rep(i, start, end) for(int i = start; i < end; ++i)
using namespace std ;
typedef long long ll ;
const double PI = 3.14159265358979323846 ;
bool isOdd(int n) { return n%2 != 0 ; }
bool isEven(int n) { return n%2 == 0; }
int main ()
{
 ///                     ▌│█║▌║▌║ AbOoOd ║▌║▌║█│▌
 ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL) ;
 ll t , n , d , x = 1 , j = 0 ;
 cin >> t ;
 while ( t -- )
 {
     j = 0 ;
     cin >> n >> d ;
     if ( d <= n ) {
        cout << "YES" << endl ;
     }
     else {
        x = (n / 2) ;
        j = x + ceil( 1.0 * d/(x+1) ) ;
        if ( j > n )
            cout << "NO" << endl ;
        else
            cout << "YES" << endl ;
     }
 }
 return 0 ;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std ;
int main()
{
  double n , d , t ;
  cin >> t ;
  while( t -- )
  {
    cin >> n >> d ;
    if( n+1 >= d )
      cout << "YES\n" ;
    else
      cout << "NO\n" ;
  }
  return 0 ;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std ;
int main()
{
  double n , d , t ;
  cin >> t ;
  while( t -- )
  {
    cin >> n >> d ;
    if( d <= n || d / n <= 1 )
      cout << "YES\n" ;
    else
      cout << "NO\n" ;
  }
  return 0 ;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std ;
int main()
{
  ll n , d , t ;
  cin >> t ;
  while( t -- )
  {
    cin >> n >> d ;
    if( d <= n || d - n < n )
      cout << "YES\n" ;
    else
      cout << "NO\n" ;
  }
  return 0 ;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std ;
int main()
{
  ll n , d , t ;
  cin >> t ;
  while( t -- )
  {
    cin >> n >> d ;
    if( d <= n || d - n <= n )
      cout << "YES\n" ;
    else
      cout << "NO\n" ;
  }
  return 0 ;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std ;
int main()
{
  ll n , d , t ;
  cin >> t ;
  while( t -- )
  {
    cin >> n >> d ;
    if( d/n <= 1  )
      cout << "YES\n" ;
    else
      cout << "NO\n" ;
  }
  return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b,x;
        double q;
        cin>>n>>d;
        if(d<=n)
        {cout<<"YES"<<endl;continue;}
        for(x=0;x<n;x++)
        {   q=(d-1)/(x+1);
            if(x+q<=n-1)
            {
                cout<<"YES"<<endl;
                break;
            }
        }
        if(x==n)
        {
            cout<<"NO"<<endl;continue;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(n*n-4*d+4<0)
        {cout<<"NO"<<endl;continue;}
        else
        {
           a=(n-2-sqrt(n*n-4*d+4));
           b=(n-2+sqrt(n*n-4*d+4))/2;
           while((a%2)!=0)
            a=a+1;
           if(a%2==0 && a/2<=b && a/2>=0)
            cout<<"YES"<<endl;
           else
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(n*n-4*d+4<0)
        {cout<<"NO"<<endl;continue;}
        else
        {
           a=(n-2-sqrt(n*n-4*d+4));
           b=(n-2+sqrt(n*n-4*d+4))/2;
           while((a%2)!=0 && a/2<b)
            a=a+1;
           if(a%2==0 && a/2<=b)
            cout<<"YES"<<endl;
           else
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b;
        cin>>n>>d;
        double q=sqrt(n*n-4*d+4);
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(q<0)
        {cout<<"NO"<<endl;continue;}
        if(q-floor(q)!=0)
        {cout<<"NO"<<endl;continue;}

           a=(n-2-q);
           b=(n-2+q);
           while((a%2)!=0 || a<0)
            a=a+1;
           if(a%2==0 && a<=b && a>=0)
            cout<<"YES"<<endl;
           else
            cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b;
        cin>>n>>d;
        double q=sqrt(n*n-4*d+4);
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(q<0)
        {cout<<"NO"<<endl;continue;}
        if(q-floor(q)!=0)
        {cout<<"NO"<<endl;continue;}

           a=(n-2-q);
           b=(n-2+q);
           while((a%2)!=0)
            a=a+1;
           if(a%2==0 && a<=b && a>=0)
            cout<<"YES"<<endl;
           else
            cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b;
        cin>>n>>d;
        double q=sqrt(n*n-4*d+4);
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(q<0)
        {cout<<"NO"<<endl;continue;}
        if(q-floor(q)!=0)
        {cout<<"NO"<<endl;continue;}

           a=(n-2-q);
           b=(n-2+q);
           while((a%2)!=0 || a<0)
            a=a+1;
           if(a%2==0 && a<=b && a>=0 && a<=n)
            cout<<"YES"<<endl;
           else
            cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(n*n-4*d+4<0)
        {cout<<"NO"<<endl;continue;}
        if((sqrt(n*n-4*d+4)*10)%10!=0)
            {cout<<"NO"<<endl;continue;}

           a=(n-2-sqrt(n*n-4*d+4));
           b=(n-2+sqrt(n*n-4*d+4))/2;
           while((a%2)!=0)
            a=a+1;
           if(a%2==0 && a/2<=b && a/2>=0  )
            cout<<"YES"<<endl;
           else
            cout<<"NO"<<endl;

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b;
        cin>>n>>d;
        double q=sqrt(n*n-4*d+4);
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(n*n-4*d+4<0)
        {cout<<"NO"<<endl;continue;}
        if(q-floor(q)!=0)
            {cout<<"NO"<<endl;continue;}

           a=(n-2-sqrt(n*n-4*d+4));
           b=(n-2+sqrt(n*n-4*d+4))/2;
           while((a%2)!=0)
            a=a+1;
           if(a%2==0 && a/2<=b && a/2>=0  )
            cout<<"YES"<<endl;
           else
            cout<<"NO"<<endl;

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,d,a,b;
        cin>>n>>d;
        double q=sqrt(n*n-4*d+4);
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }
        if(q<0)
        {cout<<"NO"<<endl;continue;}
        if(q-floor(q)!=0)
        {cout<<"NO"<<endl;continue;}

           a=(n-2-q);
           b=(n-2+q);
           while((a%2)!=0 && a<0)
            a=a+1;
           if(a%2==0 && a<=b && a>=0)
            cout<<"YES"<<endl;
           else
            cout<<"NO"<<endl;
    }
}


#include<stdio.h>
#include<math.h>
int main()
{
	int x,n,t,i,m;
	float d;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%f",&n,&d);
		if(n==d)
		{printf("YES\n");continue;}
		m=0;
		for(i=sqrt(d)-1;i<int(d);i++)
		{
			if(float(d/(i+1))>int(d/(i+1)))
			x=int(d/(i+1))+1;
			else x=int(d/(i+1));
			if((i+x)<=n) {printf("YES\n");m=1;break;}
		 }
		 if(m==0) printf("NO\n");
	}
	return 0;
 }


#include<stdio.h>
#include<math.h>
int main()
{
	int x,n,t,i,m;
	float d;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%f",&n,&d);
		if(n==d)
		{printf("YES\n");continue;}
		m=0;
		for(i=sqrt(d);i<=int(d);i++)
		{
			if(float(d/(i+1))>int(d/(i+1)))
			x=int(d/(i+1))+1;
			else x=int(d/(i+1));
			if((i+x)<=n) {printf("YES\n");m=1;break;}
		 }
		 if(m==0) printf("NO\n");
	}
	return 0;
 }


#include<stdio.h>
int main()
{
	int d,x,n,t,i,m;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&n,&d);
		if(n==d)
		{printf("YES\n");continue;}
		m=0;
		for(i=1;i<=d;i++)
		{
			if(float(d/(i+1))>int(d/(i+1)))
			x=d/(i+1)+1;
			else x=d/(i+1);
			if((i+x)<n) {printf("YES\n");m=1;break;}
		 }
		 if(m==0) printf("NO\n");
	}
	return 0;
 }


#include<stdio.h>
int main()
{
	int x,n,t,i,m;
	float d;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%f",&n,&d);
		if(n==d)
		{printf("YES\n");continue;}
		m=0;
		for(i=1;i<=int(d);i++)
		{
			if(float(d/(i+1))>int(d/(i+1)))
			x=int(d/(i+1))+1;
			else x=int(d/(i+1));
			if((i+x)<=n) {printf("YES\n");m=1;break;}
		 }
		 if(m==0) printf("NO\n");
	}
	return 0;
 }


#include<stdio.h>
int main()
{
	int d,x,n,t,i,m;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&n,&d);
		if(n==d)
		{printf("YES\n");continue;}
		m=0;
		for(i=1;i<=d;i++)
		{
			x=d/(i+1)+1;
			if((i+x)<=n) {printf("YES\n");m=1;break;}
		 }
		 if(m==0) printf("NO\n");
	}
	return 0;
 }


#include <stdio.h>
int main()
{	int t,n,d,i,ans;
	scanf("%d",&t);	while(t--){
		scanf("%d%d",&n,&d);
		if(d<=n)printf("YES\n");
		else{
		for(i=1;i*i<=d;i++){
      if(d%(i+1))ans=d/(i+1)+1;
			else ans=d/(i+1);
		ans+=i;
			if(ans<=n){
				printf("YES\n");
					break;	}	}
			if(i*i>d)printf("NO\n");
				}	}}


#include<stdio.h>
int main()
{
	int d,x,n,t,i,m;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&n,&d);
		if(n==d)
		{printf("YES\n");continue;}
		m=0;
		for(i=1;i<=d;i++)
		{
			x=int(d/(i+1));
			if((i+x)<n) {printf("YES\n");m=1;break;}
		 }
		 if(m==0) printf("NO\n");
	}
	return 0;
 }


/*************************************************************************************
                         ---------------------------
                   ------Bismillahir-Rahmanir-Rahim------
                         ---------------------------
            //     //   Name: MD: NAZMUL HASAN              //     //
           //     //    Institute: HSTU                    //     //
          //     //     Dept.: CSE                        //     //
        //     //      Email: nazmulmoon123@gmail.com   //     //
    -----------------------------------------------------------------------
            ---------- I Love Programming as Gaming ----------
**************************************************************************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
      using ordered_set = tree<T, null_type, less<T>,
          rb_tree_tag, tree_order_statistics_node_update>;
#define loop(a,b,c)   for(int a=b;a<c;a++)
#define loopa(p,v)    for(auto p:(v))
#define lloop(a,b,c)  for(long long a=b;a<c;a++)
#define rloop(a,b,c)  for(int a=c-1;a>=b;a--)
#define rlloop(a,b,c) for(long long a=c-1;a>=b;a--)
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define EPS 1e-9
#define PI acos(-1)
#define rn PI/180
#define TC(t)         scanf("%d",&t);while(t--)
#define sf scanf
#define pf printf
#define SIZE 100001
#define sp ' '
#define nl printf("\n")
#define pb push_back
#define pp pop_back
#define mp make_pair
#define ff first
#define ss second
#define gcd(a,b) __gcd(a,b)

#define si(a) sf("%d",&a)
#define sl(a) sf("%I64d",&a)
#define sii(a,b) sf("%d%d",&a,&b)
#define Pi(a) pf("%d\n",a)
#define Pin(a) pf("%d ",a)
#define Pl(a) pf("%I64d\n",a)
#define pln(a) pf("%I64d ",a)
#define b_s(v,x) binary_search(v.begin(),v.end(),x)
#define l_b(v,x) lower_bound(v.begin(),v.end(),x)
#define u_b(v,x) upper_bound(v.begin(),v.end(),x)
#define e_r(v,x) equal_range(v.begin(),v.end(),x)
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define case(x) cout<<"Case "<<x<<": "

/// ASCII Vlaue....
/// A=65,Z=90,a=97,z=122,0=48,9=57
///#define INT_MAX 2147483647
///#define INT_MIN -2147483647

const int MOD=1000000007;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<string> vs;
typedef stack<int> si;
typedef stack<string> ss;
typedef queue<int> qi;
typedef queue<string> qs;
typedef pair<int,int> pii;
typedef pair<string,int>psi;
typedef map<int,int>mii;
typedef map<string,int>msi;
///      direction
int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx8[]= {0,0,+1,-1,-1,+1,-1,+1};
int dy8[]= {-1,+1,0,0,+1,+1,-1,-1};

/*ll nCr(ll aan, ll aar)
{
    ll ii, aac=1;
    for(ii=1; ii<=aar; ii++)
    {
        aac*=(aan-aar+ii);
        aac/=ii;
    }
    return aac;
}

bool status[1100002];
void siv()
{
	int N=1000000;
	int sq=sqrt(N);
	for(int i=4;i<=N;i+=2) status[i]=1;
	for(int i=3;i<=sq;i+=2){
		if(status[i]==0)
		{
			for(int j=i*i;j<=N;j+=i) status[j]=1;
		}
	}
	status[1]=1;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0) return 1;
    if(power&1)
    {
        ll p1=base%mod;
        ll p2=(big_mod(base, power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else
    {
        ll p1=(big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
ll modInverseBigMod(ll a,ll m)  //a*x=1(mod m)
{
    return big_mod(a,m-2,m);
}**/

/*ll nCr(ll n, ll k)
{
    ll C[n+1][k+1];
    ll i, j;

    // Caculate value of Binomial Coefficient in bottom up manner
    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {
            // Base Cases
            if (j == 0 || j == i)
                C[i][j] = 1;

            // Calculate value using previosly stored values
            else
                C[i][j] = C[i-1][j-1] + C[i-1][j];
        }
    }

    return C[n][k];
}*/
///START YOUR CODE FROM HERE.... Happy Coding.... ! ;)
int main()
{
    faster
    //ifstream in("popcorn.txt");
    //ofstream out("file.txt");
    int T;
    int x,y,z;
    cin>>T;
    while(T--)
    {
        z=INT_MAX;
        cin>>x>>y;
        int left=1,right=x;
        int mid;
        if(y<=x)
        {
            cout<<"yes\n";
            continue;
        }
        while(left<right)
        {
            mid=(left+right)/2;
            z=mid+y/(mid+1)+((y%(mid+1))?1:0);
            if(z>x)
                right=mid-1;
            else
                left=mid+1,right=mid;
        }

        if(z<=x)
            cout<<"yes\n";
        else
            cout<<"no\n";
    }

    return 0;
}


/*************************************************************************************
                         ---------------------------
                   ------Bismillahir-Rahmanir-Rahim------
                         ---------------------------
            //     //   Name: MD: NAZMUL HASAN              //     //
           //     //    Institute: HSTU                    //     //
          //     //     Dept.: CSE                        //     //
        //     //      Email: nazmulmoon123@gmail.com   //     //
    -----------------------------------------------------------------------
            ---------- I Love Programming as Gaming ----------
**************************************************************************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
      using ordered_set = tree<T, null_type, less<T>,
          rb_tree_tag, tree_order_statistics_node_update>;
#define loop(a,b,c)   for(int a=b;a<c;a++)
#define loopa(p,v)    for(auto p:(v))
#define lloop(a,b,c)  for(long long a=b;a<c;a++)
#define rloop(a,b,c)  for(int a=c-1;a>=b;a--)
#define rlloop(a,b,c) for(long long a=c-1;a>=b;a--)
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define EPS 1e-9
#define PI acos(-1)
#define rn PI/180
#define TC(t)         scanf("%d",&t);while(t--)
#define sf scanf
#define pf printf
#define SIZE 100001
#define sp ' '
#define nl printf("\n")
#define pb push_back
#define pp pop_back
#define mp make_pair
#define ff first
#define ss second
#define gcd(a,b) __gcd(a,b)

#define si(a) sf("%d",&a)
#define sl(a) sf("%I64d",&a)
#define sii(a,b) sf("%d%d",&a,&b)
#define Pi(a) pf("%d\n",a)
#define Pin(a) pf("%d ",a)
#define Pl(a) pf("%I64d\n",a)
#define pln(a) pf("%I64d ",a)
#define b_s(v,x) binary_search(v.begin(),v.end(),x)
#define l_b(v,x) lower_bound(v.begin(),v.end(),x)
#define u_b(v,x) upper_bound(v.begin(),v.end(),x)
#define e_r(v,x) equal_range(v.begin(),v.end(),x)
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define case(x) cout<<"Case "<<x<<": "

/// ASCII Vlaue....
/// A=65,Z=90,a=97,z=122,0=48,9=57
///#define INT_MAX 2147483647
///#define INT_MIN -2147483647

const int MOD=1000000007;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<string> vs;
typedef stack<int> si;
typedef stack<string> ss;
typedef queue<int> qi;
typedef queue<string> qs;
typedef pair<int,int> pii;
typedef pair<string,int>psi;
typedef map<int,int>mii;
typedef map<string,int>msi;
///      direction
int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx8[]= {0,0,+1,-1,-1,+1,-1,+1};
int dy8[]= {-1,+1,0,0,+1,+1,-1,-1};

/*ll nCr(ll aan, ll aar)
{
    ll ii, aac=1;
    for(ii=1; ii<=aar; ii++)
    {
        aac*=(aan-aar+ii);
        aac/=ii;
    }
    return aac;
}

bool status[1100002];
void siv()
{
	int N=1000000;
	int sq=sqrt(N);
	for(int i=4;i<=N;i+=2) status[i]=1;
	for(int i=3;i<=sq;i+=2){
		if(status[i]==0)
		{
			for(int j=i*i;j<=N;j+=i) status[j]=1;
		}
	}
	status[1]=1;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0) return 1;
    if(power&1)
    {
        ll p1=base%mod;
        ll p2=(big_mod(base, power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else
    {
        ll p1=(big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
ll modInverseBigMod(ll a,ll m)  //a*x=1(mod m)
{
    return big_mod(a,m-2,m);
}**/

/*ll nCr(ll n, ll k)
{
    ll C[n+1][k+1];
    ll i, j;

    // Caculate value of Binomial Coefficient in bottom up manner
    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {
            // Base Cases
            if (j == 0 || j == i)
                C[i][j] = 1;

            // Calculate value using previosly stored values
            else
                C[i][j] = C[i-1][j-1] + C[i-1][j];
        }
    }

    return C[n][k];
}*/
///START YOUR CODE FROM HERE.... Happy Coding.... ! ;)
int main()
{
    faster
    //ifstream in("popcorn.txt");
    //ofstream out("file.txt");
    int T;
    int x,y,z;
    cin>>T;
    while(T--)
    {
        cin>>x>>y;
        int left=1,right=x;
        int mid;
        if(y<=x)
        {
            cout<<"yes\n";
            continue;
        }
        while(left<right)
        {
            mid=(left+right)/2;
            z=mid+y/mid+((y&mid)?1:0);
            if(z>x)
                right=mid-1;
            else
                left=right=mid;
        }
        if(z<=x)
            cout<<"yes\n";
        else
            cout<<"no\n";
    }

    return 0;
}


/*************************************************************************************
                         ---------------------------
                   ------Bismillahir-Rahmanir-Rahim------
                         ---------------------------
            //     //   Name: MD: NAZMUL HASAN              //     //
           //     //    Institute: HSTU                    //     //
          //     //     Dept.: CSE                        //     //
        //     //      Email: nazmulmoon123@gmail.com   //     //
    -----------------------------------------------------------------------
            ---------- I Love Programming as Gaming ----------
**************************************************************************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
      using ordered_set = tree<T, null_type, less<T>,
          rb_tree_tag, tree_order_statistics_node_update>;
#define loop(a,b,c)   for(int a=b;a<c;a++)
#define loopa(p,v)    for(auto p:(v))
#define lloop(a,b,c)  for(long long a=b;a<c;a++)
#define rloop(a,b,c)  for(int a=c-1;a>=b;a--)
#define rlloop(a,b,c) for(long long a=c-1;a>=b;a--)
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define EPS 1e-9
#define PI acos(-1)
#define rn PI/180
#define TC(t)         scanf("%d",&t);while(t--)
#define sf scanf
#define pf printf
#define SIZE 100001
#define sp ' '
#define nl printf("\n")
#define pb push_back
#define pp pop_back
#define mp make_pair
#define ff first
#define ss second
#define gcd(a,b) __gcd(a,b)

#define si(a) sf("%d",&a)
#define sl(a) sf("%I64d",&a)
#define sii(a,b) sf("%d%d",&a,&b)
#define Pi(a) pf("%d\n",a)
#define Pin(a) pf("%d ",a)
#define Pl(a) pf("%I64d\n",a)
#define pln(a) pf("%I64d ",a)
#define b_s(v,x) binary_search(v.begin(),v.end(),x)
#define l_b(v,x) lower_bound(v.begin(),v.end(),x)
#define u_b(v,x) upper_bound(v.begin(),v.end(),x)
#define e_r(v,x) equal_range(v.begin(),v.end(),x)
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define case(x) cout<<"Case "<<x<<": "

/// ASCII Vlaue....
/// A=65,Z=90,a=97,z=122,0=48,9=57
///#define INT_MAX 2147483647
///#define INT_MIN -2147483647

const int MOD=1000000007;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<string> vs;
typedef stack<int> si;
typedef stack<string> ss;
typedef queue<int> qi;
typedef queue<string> qs;
typedef pair<int,int> pii;
typedef pair<string,int>psi;
typedef map<int,int>mii;
typedef map<string,int>msi;
///      direction
int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx8[]= {0,0,+1,-1,-1,+1,-1,+1};
int dy8[]= {-1,+1,0,0,+1,+1,-1,-1};

/*ll nCr(ll aan, ll aar)
{
    ll ii, aac=1;
    for(ii=1; ii<=aar; ii++)
    {
        aac*=(aan-aar+ii);
        aac/=ii;
    }
    return aac;
}

bool status[1100002];
void siv()
{
	int N=1000000;
	int sq=sqrt(N);
	for(int i=4;i<=N;i+=2) status[i]=1;
	for(int i=3;i<=sq;i+=2){
		if(status[i]==0)
		{
			for(int j=i*i;j<=N;j+=i) status[j]=1;
		}
	}
	status[1]=1;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0) return 1;
    if(power&1)
    {
        ll p1=base%mod;
        ll p2=(big_mod(base, power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else
    {
        ll p1=(big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
ll modInverseBigMod(ll a,ll m)  //a*x=1(mod m)
{
    return big_mod(a,m-2,m);
}**/

/*ll nCr(ll n, ll k)
{
    ll C[n+1][k+1];
    ll i, j;

    // Caculate value of Binomial Coefficient in bottom up manner
    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {
            // Base Cases
            if (j == 0 || j == i)
                C[i][j] = 1;

            // Calculate value using previosly stored values
            else
                C[i][j] = C[i-1][j-1] + C[i-1][j];
        }
    }

    return C[n][k];
}*/
///START YOUR CODE FROM HERE.... Happy Coding.... ! ;)
int main()
{
    faster
    //ifstream in("popcorn.txt");
    //ofstream out("file.txt");
    int T;
    int x,y,z;
    cin>>T;
    while(T--)
    {
        z=INT_MAX;
        cin>>x>>y;
        int left=1,right=x;
        int mid;
        if(y<=x)
        {
            cout<<"yes\n";
            continue;
        }
        while(left<=right)
        {
            mid=(left+right)/2;
            z=mid+y/(mid+1)+((y%(mid+1))?1:0);
            if(z>x)
                right=mid;
            else
                left=mid+1,right=mid;
        }

        if(z<=x)
            cout<<"yes\n";
        else
            cout<<"no\n";
    }

    return 0;
}


/*************************************************************************************
                         ---------------------------
                   ------Bismillahir-Rahmanir-Rahim------
                         ---------------------------
            //     //   Name: MD: NAZMUL HASAN              //     //
           //     //    Institute: HSTU                    //     //
          //     //     Dept.: CSE                        //     //
        //     //      Email: nazmulmoon123@gmail.com   //     //
    -----------------------------------------------------------------------
            ---------- I Love Programming as Gaming ----------
**************************************************************************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
      using ordered_set = tree<T, null_type, less<T>,
          rb_tree_tag, tree_order_statistics_node_update>;
#define loop(a,b,c)   for(int a=b;a<c;a++)
#define loopa(p,v)    for(auto p:(v))
#define lloop(a,b,c)  for(long long a=b;a<c;a++)
#define rloop(a,b,c)  for(int a=c-1;a>=b;a--)
#define rlloop(a,b,c) for(long long a=c-1;a>=b;a--)
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define EPS 1e-9
#define PI acos(-1)
#define rn PI/180
#define TC(t)         scanf("%d",&t);while(t--)
#define sf scanf
#define pf printf
#define SIZE 100001
#define sp ' '
#define nl printf("\n")
#define pb push_back
#define pp pop_back
#define mp make_pair
#define ff first
#define ss second
#define gcd(a,b) __gcd(a,b)

#define si(a) sf("%d",&a)
#define sl(a) sf("%I64d",&a)
#define sii(a,b) sf("%d%d",&a,&b)
#define Pi(a) pf("%d\n",a)
#define Pin(a) pf("%d ",a)
#define Pl(a) pf("%I64d\n",a)
#define pln(a) pf("%I64d ",a)
#define b_s(v,x) binary_search(v.begin(),v.end(),x)
#define l_b(v,x) lower_bound(v.begin(),v.end(),x)
#define u_b(v,x) upper_bound(v.begin(),v.end(),x)
#define e_r(v,x) equal_range(v.begin(),v.end(),x)
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define case(x) cout<<"Case "<<x<<": "

/// ASCII Vlaue....
/// A=65,Z=90,a=97,z=122,0=48,9=57
///#define INT_MAX 2147483647
///#define INT_MIN -2147483647

const int MOD=1000000007;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<string> vs;
typedef stack<int> si;
typedef stack<string> ss;
typedef queue<int> qi;
typedef queue<string> qs;
typedef pair<int,int> pii;
typedef pair<string,int>psi;
typedef map<int,int>mii;
typedef map<string,int>msi;
///      direction
int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx8[]= {0,0,+1,-1,-1,+1,-1,+1};
int dy8[]= {-1,+1,0,0,+1,+1,-1,-1};

/*ll nCr(ll aan, ll aar)
{
    ll ii, aac=1;
    for(ii=1; ii<=aar; ii++)
    {
        aac*=(aan-aar+ii);
        aac/=ii;
    }
    return aac;
}

bool status[1100002];
void siv()
{
	int N=1000000;
	int sq=sqrt(N);
	for(int i=4;i<=N;i+=2) status[i]=1;
	for(int i=3;i<=sq;i+=2){
		if(status[i]==0)
		{
			for(int j=i*i;j<=N;j+=i) status[j]=1;
		}
	}
	status[1]=1;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0) return 1;
    if(power&1)
    {
        ll p1=base%mod;
        ll p2=(big_mod(base, power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else
    {
        ll p1=(big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
ll modInverseBigMod(ll a,ll m)  //a*x=1(mod m)
{
    return big_mod(a,m-2,m);
}**/

/*ll nCr(ll n, ll k)
{
    ll C[n+1][k+1];
    ll i, j;

    // Caculate value of Binomial Coefficient in bottom up manner
    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {
            // Base Cases
            if (j == 0 || j == i)
                C[i][j] = 1;

            // Calculate value using previosly stored values
            else
                C[i][j] = C[i-1][j-1] + C[i-1][j];
        }
    }

    return C[n][k];
}*/
///START YOUR CODE FROM HERE.... Happy Coding.... ! ;)
int main()
{
    faster
    //ifstream in("popcorn.txt");
    //ofstream out("file.txt");
    int T;
    int x,y,z;
    cin>>T;
    while(T--)
    {
        z=INT_MAX;
        cin>>x>>y;
        int left=1,right=x;
        int mid;
        if(y<=x)
        {
            cout<<"yes\n";
            continue;
        }
        while(left<right)
        {
            mid=(left+right)/2;
            z=mid+y/(mid+1)+((y&(mid+1))?1:0);
            if(z>x)
                right=mid-1;
            else
                left=mid+1,right=mid;
        }

        if(z<=x)
            cout<<"yes\n";
        else
            cout<<"no\n";
    }

    return 0;
}


/*************************************************************************************
                         ---------------------------
                   ------Bismillahir-Rahmanir-Rahim------
                         ---------------------------
            //     //   Name: MD: NAZMUL HASAN              //     //
           //     //    Institute: HSTU                    //     //
          //     //     Dept.: CSE                        //     //
        //     //      Email: nazmulmoon123@gmail.com   //     //
    -----------------------------------------------------------------------
            ---------- I Love Programming as Gaming ----------
**************************************************************************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
      using ordered_set = tree<T, null_type, less<T>,
          rb_tree_tag, tree_order_statistics_node_update>;
#define loop(a,b,c)   for(int a=b;a<c;a++)
#define loopa(p,v)    for(auto p:(v))
#define lloop(a,b,c)  for(long long a=b;a<c;a++)
#define rloop(a,b,c)  for(int a=c-1;a>=b;a--)
#define rlloop(a,b,c) for(long long a=c-1;a>=b;a--)
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define EPS 1e-9
#define PI acos(-1)
#define rn PI/180
#define TC(t)         scanf("%d",&t);while(t--)
#define sf scanf
#define pf printf
#define SIZE 100001
#define sp ' '
#define nl printf("\n")
#define pb push_back
#define pp pop_back
#define mp make_pair
#define ff first
#define ss second
#define gcd(a,b) __gcd(a,b)

#define si(a) sf("%d",&a)
#define sl(a) sf("%I64d",&a)
#define sii(a,b) sf("%d%d",&a,&b)
#define Pi(a) pf("%d\n",a)
#define Pin(a) pf("%d ",a)
#define Pl(a) pf("%I64d\n",a)
#define pln(a) pf("%I64d ",a)
#define b_s(v,x) binary_search(v.begin(),v.end(),x)
#define l_b(v,x) lower_bound(v.begin(),v.end(),x)
#define u_b(v,x) upper_bound(v.begin(),v.end(),x)
#define e_r(v,x) equal_range(v.begin(),v.end(),x)
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define case(x) cout<<"Case "<<x<<": "

/// ASCII Vlaue....
/// A=65,Z=90,a=97,z=122,0=48,9=57
///#define INT_MAX 2147483647
///#define INT_MIN -2147483647

const int MOD=1000000007;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<string> vs;
typedef stack<int> si;
typedef stack<string> ss;
typedef queue<int> qi;
typedef queue<string> qs;
typedef pair<int,int> pii;
typedef pair<string,int>psi;
typedef map<int,int>mii;
typedef map<string,int>msi;
///      direction
int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx8[]= {0,0,+1,-1,-1,+1,-1,+1};
int dy8[]= {-1,+1,0,0,+1,+1,-1,-1};

/*ll nCr(ll aan, ll aar)
{
    ll ii, aac=1;
    for(ii=1; ii<=aar; ii++)
    {
        aac*=(aan-aar+ii);
        aac/=ii;
    }
    return aac;
}

bool status[1100002];
void siv()
{
	int N=1000000;
	int sq=sqrt(N);
	for(int i=4;i<=N;i+=2) status[i]=1;
	for(int i=3;i<=sq;i+=2){
		if(status[i]==0)
		{
			for(int j=i*i;j<=N;j+=i) status[j]=1;
		}
	}
	status[1]=1;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0) return 1;
    if(power&1)
    {
        ll p1=base%mod;
        ll p2=(big_mod(base, power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else
    {
        ll p1=(big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
ll modInverseBigMod(ll a,ll m)  //a*x=1(mod m)
{
    return big_mod(a,m-2,m);
}**/

/*ll nCr(ll n, ll k)
{
    ll C[n+1][k+1];
    ll i, j;

    // Caculate value of Binomial Coefficient in bottom up manner
    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {
            // Base Cases
            if (j == 0 || j == i)
                C[i][j] = 1;

            // Calculate value using previosly stored values
            else
                C[i][j] = C[i-1][j-1] + C[i-1][j];
        }
    }

    return C[n][k];
}*/
///START YOUR CODE FROM HERE.... Happy Coding.... ! ;)
int main()
{
    faster
    //ifstream in("popcorn.txt");
    //ofstream out("file.txt");
    int T;
    int x,y,z;
    cin>>T;
    while(T--)
    {
        z=INT_MAX;
        cin>>x>>y;
        int left=1,right=x;
        int mid;
        if(y<=x)
        {
            cout<<"yes\n";
            continue;
        }
        while(left<=right)
        {
            mid=(left+right)/2;
            z=mid+y/(mid+1)+((y%(mid+1))?1:0);
            if(z>x)
                right=mid-1;
            else
                left=mid+1,right=mid;
        }

        if(z<=x)
            cout<<"yes\n";
        else
            cout<<"no\n";
    }

    return 0;
}


/*************************************************************************************
                         ---------------------------
                   ------Bismillahir-Rahmanir-Rahim------
                         ---------------------------
            //     //   Name: MD: NAZMUL HASAN              //     //
           //     //    Institute: HSTU                    //     //
          //     //     Dept.: CSE                        //     //
        //     //      Email: nazmulmoon123@gmail.com   //     //
    -----------------------------------------------------------------------
            ---------- I Love Programming as Gaming ----------
**************************************************************************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
      using ordered_set = tree<T, null_type, less<T>,
          rb_tree_tag, tree_order_statistics_node_update>;
#define loop(a,b,c)   for(int a=b;a<c;a++)
#define loopa(p,v)    for(auto p:(v))
#define lloop(a,b,c)  for(long long a=b;a<c;a++)
#define rloop(a,b,c)  for(int a=c-1;a>=b;a--)
#define rlloop(a,b,c) for(long long a=c-1;a>=b;a--)
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define EPS 1e-9
#define PI acos(-1)
#define rn PI/180
#define TC(t)         scanf("%d",&t);while(t--)
#define sf scanf
#define pf printf
#define SIZE 100001
#define sp ' '
#define nl printf("\n")
#define pb push_back
#define pp pop_back
#define mp make_pair
#define ff first
#define ss second
#define gcd(a,b) __gcd(a,b)

#define si(a) sf("%d",&a)
#define sl(a) sf("%I64d",&a)
#define sii(a,b) sf("%d%d",&a,&b)
#define Pi(a) pf("%d\n",a)
#define Pin(a) pf("%d ",a)
#define Pl(a) pf("%I64d\n",a)
#define pln(a) pf("%I64d ",a)
#define b_s(v,x) binary_search(v.begin(),v.end(),x)
#define l_b(v,x) lower_bound(v.begin(),v.end(),x)
#define u_b(v,x) upper_bound(v.begin(),v.end(),x)
#define e_r(v,x) equal_range(v.begin(),v.end(),x)
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define case(x) cout<<"Case "<<x<<": "

/// ASCII Vlaue....
/// A=65,Z=90,a=97,z=122,0=48,9=57
///#define INT_MAX 2147483647
///#define INT_MIN -2147483647

const int MOD=1000000007;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<string> vs;
typedef stack<int> si;
typedef stack<string> ss;
typedef queue<int> qi;
typedef queue<string> qs;
typedef pair<int,int> pii;
typedef pair<string,int>psi;
typedef map<int,int>mii;
typedef map<string,int>msi;
///      direction
int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx8[]= {0,0,+1,-1,-1,+1,-1,+1};
int dy8[]= {-1,+1,0,0,+1,+1,-1,-1};

/*ll nCr(ll aan, ll aar)
{
    ll ii, aac=1;
    for(ii=1; ii<=aar; ii++)
    {
        aac*=(aan-aar+ii);
        aac/=ii;
    }
    return aac;
}

bool status[1100002];
void siv()
{
	int N=1000000;
	int sq=sqrt(N);
	for(int i=4;i<=N;i+=2) status[i]=1;
	for(int i=3;i<=sq;i+=2){
		if(status[i]==0)
		{
			for(int j=i*i;j<=N;j+=i) status[j]=1;
		}
	}
	status[1]=1;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0) return 1;
    if(power&1)
    {
        ll p1=base%mod;
        ll p2=(big_mod(base, power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else
    {
        ll p1=(big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
ll modInverseBigMod(ll a,ll m)  //a*x=1(mod m)
{
    return big_mod(a,m-2,m);
}**/

/*ll nCr(ll n, ll k)
{
    ll C[n+1][k+1];
    ll i, j;

    // Caculate value of Binomial Coefficient in bottom up manner
    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {
            // Base Cases
            if (j == 0 || j == i)
                C[i][j] = 1;

            // Calculate value using previosly stored values
            else
                C[i][j] = C[i-1][j-1] + C[i-1][j];
        }
    }

    return C[n][k];
}*/
///START YOUR CODE FROM HERE.... Happy Coding.... ! ;)
int main()
{
    faster
    //ifstream in("popcorn.txt");
    //ofstream out("file.txt");
    int T;
    int x,y,z;
    cin>>T;
    while(T--)
    {
        z=INT_MAX;
        cin>>x>>y;
        int left=1,right=x;
        int mid;
        if(y<=x)
        {
            cout<<"yes\n";
            continue;
        }
        while(left<right)
        {
            mid=(left+right)/2;
            z=mid+y/(mid+1)+((y%(mid+1))?1:0);
            if(z>x)
                right=mid;
            else
                left=mid+1,right=mid;
        }

        if(z<=x)
            cout<<"yes\n";
        else
            cout<<"no\n";
    }

    return 0;
}


/*************************************************************************************
                         ---------------------------
                   ------Bismillahir-Rahmanir-Rahim------
                         ---------------------------
            //     //   Name: MD: NAZMUL HASAN              //     //
           //     //    Institute: HSTU                    //     //
          //     //     Dept.: CSE                        //     //
        //     //      Email: nazmulmoon123@gmail.com   //     //
    -----------------------------------------------------------------------
            ---------- I Love Programming as Gaming ----------
**************************************************************************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
      using ordered_set = tree<T, null_type, less<T>,
          rb_tree_tag, tree_order_statistics_node_update>;
#define loop(a,b,c)   for(int a=b;a<c;a++)
#define loopa(p,v)    for(auto p:(v))
#define lloop(a,b,c)  for(long long a=b;a<c;a++)
#define rloop(a,b,c)  for(int a=c-1;a>=b;a--)
#define rlloop(a,b,c) for(long long a=c-1;a>=b;a--)
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define EPS 1e-9
#define PI acos(-1)
#define rn PI/180
#define TC(t)         scanf("%d",&t);while(t--)
#define sf scanf
#define pf printf
#define SIZE 100001
#define sp ' '
#define nl printf("\n")
#define pb push_back
#define pp pop_back
#define mp make_pair
#define ff first
#define ss second
#define gcd(a,b) __gcd(a,b)

#define si(a) sf("%d",&a)
#define sl(a) sf("%I64d",&a)
#define sii(a,b) sf("%d%d",&a,&b)
#define Pi(a) pf("%d\n",a)
#define Pin(a) pf("%d ",a)
#define Pl(a) pf("%I64d\n",a)
#define pln(a) pf("%I64d ",a)
#define b_s(v,x) binary_search(v.begin(),v.end(),x)
#define l_b(v,x) lower_bound(v.begin(),v.end(),x)
#define u_b(v,x) upper_bound(v.begin(),v.end(),x)
#define e_r(v,x) equal_range(v.begin(),v.end(),x)
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define case(x) cout<<"Case "<<x<<": "

/// ASCII Vlaue....
/// A=65,Z=90,a=97,z=122,0=48,9=57
///#define INT_MAX 2147483647
///#define INT_MIN -2147483647

const int MOD=1000000007;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<string> vs;
typedef stack<int> si;
typedef stack<string> ss;
typedef queue<int> qi;
typedef queue<string> qs;
typedef pair<int,int> pii;
typedef pair<string,int>psi;
typedef map<int,int>mii;
typedef map<string,int>msi;
///      direction
int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx8[]= {0,0,+1,-1,-1,+1,-1,+1};
int dy8[]= {-1,+1,0,0,+1,+1,-1,-1};

/*ll nCr(ll aan, ll aar)
{
    ll ii, aac=1;
    for(ii=1; ii<=aar; ii++)
    {
        aac*=(aan-aar+ii);
        aac/=ii;
    }
    return aac;
}

bool status[1100002];
void siv()
{
	int N=1000000;
	int sq=sqrt(N);
	for(int i=4;i<=N;i+=2) status[i]=1;
	for(int i=3;i<=sq;i+=2){
		if(status[i]==0)
		{
			for(int j=i*i;j<=N;j+=i) status[j]=1;
		}
	}
	status[1]=1;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0) return 1;
    if(power&1)
    {
        ll p1=base%mod;
        ll p2=(big_mod(base, power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else
    {
        ll p1=(big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
ll modInverseBigMod(ll a,ll m)  //a*x=1(mod m)
{
    return big_mod(a,m-2,m);
}**/

/*ll nCr(ll n, ll k)
{
    ll C[n+1][k+1];
    ll i, j;

    // Caculate value of Binomial Coefficient in bottom up manner
    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {
            // Base Cases
            if (j == 0 || j == i)
                C[i][j] = 1;

            // Calculate value using previosly stored values
            else
                C[i][j] = C[i-1][j-1] + C[i-1][j];
        }
    }

    return C[n][k];
}*/
///START YOUR CODE FROM HERE.... Happy Coding.... ! ;)
int main()
{
    faster
    //ifstream in("popcorn.txt");
    //ofstream out("file.txt");
    int T;
    int x,y,z;
    cin>>T;
    while(T--)
    {
        z=INT_MAX;
        cin>>x>>y;
        int left=1,right=x;
        int mid;
        if(y<=x)
        {
            cout<<"yes\n";
            continue;
        }
        while(left<right)
        {
            mid=(left+right)/2;
            z=mid+y/mid+((y&mid)?1:0);
            if(z>x)
                right=mid-1;
            else
                left=right=mid;
        }
        if(z<=x)
            cout<<"yes\n";
        else
            cout<<"no\n";
    }

    return 0;
}