#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 6;
int suffix[3][MAXN];
int n, a, b, m;
char str[MAXN];
int toI(char c)
{
    if(c == 'w') return 1;
    else return 2;
}
void init()
{
    suffix[1][n] = suffix[2][n] = 0;
    for(int k = 1 ; k <= 2 ; k++) {
        int pre = k;
        for(int i = n - 1 ; i >= 0 ; i--) {
            suffix[k][i] = suffix[k][i + 1] + a;
            if(toI(str[i]) != pre) {
                suffix[k][i] += b;
                pre = str[i];
            }
        }
    }
}
int main()
{
    scanf("%d%d%d%d", &n, &a, &b, &m);
        scanf("%s", str);
        init();
        int now = 0;
        int ans = 0;
        int pre = 2;
        int cost1 = 0;
        while(now < n && cost1 + suffix[pre][now] + a * 1 > m) now++;
        if(suffix[pre][now] <= m) ans = max(ans, n - now);
        for(int i = 0 ; i < n ; i++) {
            cost1 +=  1 + a;
            if(i == 0) cost1 -= a;
            if(toI(str[i]) != pre) {
                pre = toI(str[i]);
                cost1 += b;
            }
            while(now <= i) now++;
            while(now < n && cost1 + suffix[pre][now] + a * (i + 1) > m) now++;
            if(cost1 + suffix[pre][now] + a * (i + 1) > m) break;
            ans = max(ans, i + 1 + (n - now));
        }
        printf("%d\n", ans);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 6;
int suffix[3][MAXN];
int n, a, b, m;
char str[MAXN];
int toI(char c)
{
    if(c == 'w') return 1;
    else return 2;
}
void init()
{
    suffix[1][n] = suffix[2][n] = 0;
    for(int k = 1 ; k <= 2 ; k++) {
        int pre = k;
        for(int i = n - 1 ; i >= 0 ; i--) {
            suffix[k][i] = suffix[k][i + 1] + a;
            if(toI(str[i]) != pre) {
                suffix[k][i] += b;
                pre = str[i];
            }
        }
    }
}
int main()
{
//    while(1) {
    scanf("%d%d%d%d", &n, &a, &b, &m);
        scanf("%s", str);
        init();
        int now = 0;
        int ans = 0;
        int pre = 2;
        int cost1 = 0;
        for(int i = 0 ; i < n ; i++) {
            cost1 +=  1 + a;
            if(i == 0) cost1 -= a;
            if(toI(str[i]) != pre) {
                pre = toI(str[i]);
                cost1 += b;
            }
            while(now <= i) now++;
            while(now < n && cost1 + suffix[pre][now] + a * i > m) now++;
            if(cost1 + suffix[pre][now] + a * i > m) {
                if(cost1 < m) ans = max(ans, i + 1);
                else break;
            }
            else
                ans = max(ans, i + 1 + (n - now));
        }

        int len = strlen(str);
        for(int i = 1 ; i < (len + 1) / 2 ; i++) swap(str[i], str[len - i]);
//        cout <<str << endl;
        init();
        now = 0;
        pre = 2;
        cost1 = 0;
        for(int i = 0 ; i < n ; i++) {
            cost1 +=  1 + a;
            if(i == 0) cost1 -= a;
            if(toI(str[i]) != pre) {
                pre = toI(str[i]);
                cost1 += b;
            }
            while(now <= i) now++;
            while(now < n && cost1 + suffix[pre][now] + a * i > m) now++;
            if(cost1 + suffix[pre][now] + a * i > m) {
                if(cost1 < m) ans = max(ans, i + 1);
                else break;
            }
            else
                ans = max(ans, i + 1 + (n - now));
        }

        printf("%d\n", ans);
//    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

void fast_IO(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

void test(){
	freopen("test.in", "r", stdin);
	freopen("test.out", "w", stdout);
}

int n, d;

double func(double num){
	return num+d/(num+1);
}

void solve(){
	cin >> n >> d;
	double l=0, r=d;
	for(int i=0; i<600; i++){
		double mid1=l+(r-l)/3;
		double mid2=r-(r-l)/3;
		if(func(mid1)<=func(mid2))
			r=mid2;
		else
			l=mid1;
	}
	int minc=0;
	l=func(l);
	if(int(l*10)%10>0)
		minc=(int)(l)+1;
	else
		minc=(int)(l);
	if(int(r*10)%10>0)
		minc=min(int(func(r))+1, minc);
	else
		minc=min(int(func(r)), minc);
	if(minc<=n)
		cout << "YES" << "\n";
	else
		cout << "NO" << "\n";
}

int main(){
	fast_IO();
	//test();
	int t=1;
	cin >> t;
	while(t--)
		solve();

	return 0;
}


#include <iostream>
#include <cmath>
int t,d,n;

using namespace std;
int main() {

  cin >> t;
  while(t--)
  {
    cin >> n >> d;
    for(int i=0; i<=n-1; i++)
    {
      if((i + ceil((double)d/(i+1)))<=n)
      {
        cout << "YES" << endl;
        break;
      }
      else if(i==n-1)
      {
        cout << "NO"<< endl;
      }
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t,i,cnt=0,tmp=1;
    scanf("%d",&t);
    vector<int>vc;
    map<int,int>mp;
    for(int i=0;i<t;i++){
        int n,d;
        cnt=0;
        scanf("%d %d",&n,&d);
        if(d<=n){
            printf("YES\n");
            continue;
        }
        int x=n/2,res;
        res=d/(x+1);
        if(d%(x+1)!=0){
            res++;
        }
        if(x+res<=n){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }

    }

    return 0;
}


#include<bits/stdc++.h>
#define int long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define all(a) a.begin(),a.end()
#define ld long double
#define ub upper_bound
#define lb lower_bound
#define pii pair<int,int>
using namespace std;
signed main()
{
    fast;
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        if(d<=n)
        {
          cout<<"YES\n";
        }
        else
        {
            int x = ((int)1-n)*((int)1-n)-(int)4*(d-n);
            if(x<0)
              cout<<"NO\n";
            else cout<<"YES\n";
        }
    }
}


#include<bits/stdc++.h>
#include<iostream>
using namespace std;
 int main()
 {
 	ios::sync_with_stdio(0);cin.tie(0);
 int t;
 cin>>t;
 while(t--)
 {
 	double a,b;
 	cin>>a>>b;
 	int k=0;
 	for(int i=0;i<=a;i++)
 	{
 		if((i+ceil(b/(i+1)))<=a)
 		{
		 k=1;break;
 	}
	 }
	 if(k)cout<<"YES"<<'\n';
	 else cout<<"NO"<<'\n';
 }

 }


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y,y2;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        int x = floor((float)d/n); //x>=2

        while(x<=d)
        {
            y = (ceil((float)d/x);
            if(y+x-1<=n)
            {
                f=1;
                break;
            }
            x++;

        }

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y,y2;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        int x = floor((float)d/n); //x>=2

        while(x<=d)
        {
            y = (ceil((float)d/x);
            if(y<=n)
            {
                f=1;
                break;
            }
            x++;
            y2 = (ceil((float)d/x);
            if(y1-y2<=1)
                break;

        }

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        y = (float)(sqrt((double)(1+4*d))-1)/2;

        if(y-1+ceil((float)d/y) <= n)
            f=1;
        if(y+ceil((float)d/(y+1)) <= n)
            f=1;
        if(y-2+ceil((float)d/(y-1)) <= n)
            f=1;

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y,y2;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        int x = floor((float)d/n); //x>=2

        while(x<=d)
        {
            y = ceil((float)d/x);
            if(y+x-1<=n)
            {
                f=1;
                break;
            }
            x++;
            y2 = (ceil((float)d/x);
            if(y1-y2<=1)
                break;

        }

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        y = (sqrt(1+4*d)-1)/2;

        if(y-1+ceil((float)d/y) <= n)
            f=1;
        if(y+ceil((float)d/(y+1)) <= n)
            f=1;
        if(y-2+ceil((float)d/(y-1)) <= n)
            f=1;

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y,y2;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        y = (sqrt(1+4*d)-1)/2;

        if(y-1+ceil((floor)d/y) <= n)
            f=1;
        if(y+ceil((floor)d/y+1) <= n)
            f=1;
        if(y-2+ceil((floor)d/y-1) <= n)
            f=1;

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        y = (sqrt(1+4*d)-1)/2;

        if(y-1+ceil((floor)d/y) <= n)
            f=1;
        if(y+ceil((floor)d/y+1) <= n)
            f=1;
        if(y-2+ceil((floor)d/y-1) <= n)
            f=1;

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        ll n,d,f=0,y;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        y = ((float)sqrt((double)(1+4*d))-1)/2;

        if(y-1+ceil((float)d/y) <= n)
            f=1;
        if(y+ceil((float)d/(y+1)) <= n)
            f=1;
        if(y-2+ceil((float)d/(y-1)) <= n)
            f=1;

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        y = ((float)sqrt((double)(1+4*d))-1)/2;

        if(y-1+ceil((float)d/y) <= n)
            f=1;
        if(y+ceil((float)d/(y+1)) <= n)
            f=1;
        if(y-2+ceil((float)d/(y-1)) <= n)
            f=1;

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        int x = floor((float)d/n); //x>=2

        while(x<=d)
        {
            if((ceil((float)d/x)+x-1)<=n)
            {
                f=1;
                break;
            }
            x++;
        }

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    test
    {
        int n,d,f=0,y,y2;
        cin>>n>>d;
        if(d<=n)
        {
            cout<<"YES\n";
            continue;
        }

        int x = floor((float)d/n); //x>=2

        while(x<=d)
        {
            y = ceil((float)d/x);
            if(y+x-1<=n)
            {
                f=1;
                break;
            }
            x++;

        }

        if(f)
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


# include <bits/stdc++.h>
    using namespace std ;
    int alisher, n, d, x1, x2, ok;
    int main () {
       cin >> alisher ;
       while( alisher -- ) {
          cin >> n >>  d ;
          int kj =  11212 ;
          if( kj == 1 ) cout << 12 << endl;
           if( n == 1 ) {
           if( n == d ) cout << "YES" << endl;
           else cout << "NO" << endl;
           continue ;
         }
         for( int i = 1; i <= sqrt(d) ; i ++ ) {
           x1 = d / (i+1) ;
           if( d % (i + 1 ) ) x1 ++ ;
           if( x1 + i <= n ){
				 cout<<"YES\n";
				 ok++;
				 break;
			}
         }
          if(ok==0) cout << "NO" << endl;
         ok=0;
      }
    }

    //sdjlkfhskjdhfewihpru-999xcvzzxcuhiuhjkljik999999ewipjl


# include <bits/stdc++.h>
    using namespace std ;
    int alisher, n, d, x1, x2, ok;
    int main () {
       cin >> alisher ;
       while( alisher -- ) {
          cin >> n >>  d ;
          int kj =  11212 ;
          if( kj == 1 ) cout << "jdshfkjs" << endl;
           if( n == 1 ) {
           if( n == d ) cout << "YES" << endl;
           else cout << "NO" << endl;
           continue ;
         }
         string sfkjsld = "jdfhkjashdfk" ;
         if( kj == 2 ) cout << 32423 << endl;
         for( int i = 1; i <= sqrt(d) ; i ++ ) {
           x1 = d / (i+1) ;
           if( d % (i + 1 ) ) x1 ++ ;
           if( x1 + i <= n ){
				 cout<<"YES\n";
				 ok++;
				 break;
			}
         }
          if(ok==0) cout << "NO" << endl;
         ok=0;
      }
    }

    //sdjlkfhskjdhfewihpru-999xcvzzxcuhiuhjkljik999999ewipjl


# include <bits/stdc++.h>
    using namespace std ;
    int alisher, n, d, x1, x2, ok;
    int main () {
       cin >> alisher ;
       while( alisher -- ) {
         cin >> n >>  d ;
         if( n == 1 ) {
           if( n == d ) cout << "YES" << endl;
           else cout << "NO" << endl;
           continue ;
         }
         for( int i = 1; i <= sqrt(d) ; i ++ ) {
           x1 = d / (i+1) ;
           if( d % (i + 1 ) ) x1 ++ ;
           if( x1 + i <= n ){
				 cout<<"YES\n";
				 ok++;
				 break;
			}
         }
          if(ok==0) cout << "NO" << endl;
         ok=0;
      }
    }


# include <bits/stdc++.h>
    using namespace std ;
    int alisher, n, d, x1, x2, ok;
    int main () {
       cin >> alisher ;
       while( alisher -- ) {
         cin >> n >>  d ;
         if( n == 1 ) {
           if( n == d ) cout << "YES" << endl;
           else cout << "NO" << endl;
           continue ;
         }
         for( int i = 1; i <= sqrt(d) ; i ++ ) {
           x1 = d / (i+1) ;
           if( d % (i + 1 ) ) x1 ++ ;
           if( x1 + i <= n ){
				 cout<<"YES\n";
				 ok++;
				 break;
			}
         }
         if(ok==0) cout << "NO" << endl;
         ok=0;
      }
    }


# include <bits/stdc++.h>
    using namespace std ;
    int alisher, n, d, x1, x2, ok;
    int main () {
       cin >> alisher ;
       while( alisher -- ) {
         cin >> n >>  d ;
            if( n == 1 ) {
           if( n == d ) cout << "YES" << endl;
           else cout << "NO" << endl;
           continue ;
         }
         for( int i = 1; i <= sqrt(d) ; i ++ ) {
           x1 = d / (i+1) ;
           if( d % (i + 1 ) ) x1 ++ ;
           if( x1 + i <= n ){
				 cout<<"YES\n";
				 ok++;
				 break;
			}
         }
          if(ok==0) cout << "NO" << endl;
         ok=0;
      }
    }


# include <bits/stdc++.h>
    using namespace std ;
    int alisher, n, d, x1, x2, ok;
    int main () {
       cin >> alisher ;
       while( alisher -- ) {
          cin >> n >>  d ;
            if( n == 1 ) {
           if( n == d ) cout << "YES" << endl;
           else cout << "NO" << endl;
           continue ;
         }
         for( int i = 1; i <= sqrt(d) ; i ++ ) {
           x1 = d / (i+1) ;
           if( d % (i + 1 ) ) x1 ++ ;
           if( x1 + i <= n ){
				 cout<<"YES\n";
				 ok++;
				 break;
			}
         }
          if(ok==0) cout << "NO" << endl;
         ok=0;
      }
    }

    //sdjlkfhskjdhfewihpru-999999999ewipjl


# include <bits/stdc++.h>
    using namespace std ;
    int alisher, n, d, x1, x2, ok;
    int main () {
       cin >> alisher ;
       while( alisher -- ) {
         cin >> n >>  d ;
         if( n == 1 ) {
           if( n == d ) cout << "YES" << endl;
           else cout << "NO" << endl;
           continue ;
         }
         for( int i = 1; i <= sqrt(d) ; i ++ ) {
           x1 = d / (i+1) ;
           if( d % (i + 1 ) ) x1 ++ ;
           if( x1 + i <= n ){
				 cout<<"YES\n";
				 ok++;
				 break;
			}
         }
         if(ok==0) cout << "NO" << endl;
      }
    }


#include <bits/stdc++.h>
using namespace std;
int main() {
    char n;
    string s;
    cin >> n;
    cout<<int(n);

    return 0;
}


//cnt0 += s[i] == '0';
#include <bits/stdc++.h>
#include <set>
# define ll long long
# define str string
# define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
# define time cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
using namespace std;
vector < pair < string , int > > A,B;
set<int> st,st1;
ll a,b,c,d,e,f,g,h,cnt=1,bnt,l,x,y,z,t1=1,t2=2,t3,ind,i;
str s,sg,stg;
int main(){
	speed;
	cin>>a;
	int arr[a+5];
	for (int i = 0; i<a; ++i){
		cin>>arr[i];
	}
	ind=i;
	for (i = 0; i <a; ++i){
		if(arr[i]!=-1 and arr[i]==arr[i+1]) cnt++;
		else if(arr[i]!=2005 and arr[i]==2005 and arr[ind]==arr[i]) cnt++;
		else if(cnt>=3){
			for (int j = ind; j < i; ++j){
				arr[j]=-1;
			}
			for (int i = 0; i < ; ++i){

			}
			if(cnt==1) bnt+=cnt-1;
			else bnt+=cnt;
			cnt=1;
			i=-1;
		}
		else if(arr[i]!=-1 and arr[i+1]!=-1 and arr[i]!=arr[i+1]) {
			cnt=1;
			ind=i+1;
		}
	}
	cout<<bnt<<' ';

	time;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            int h = ceil(d / 2.0) + 1;
            if (h <= n || h <= n + 1)    cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            bool flag = false;
            for (int i = 1; i < 10; i++) {
                int h = i + ceil((double)d / (i + 1));
                if (h <= n) {
                    flag = true;
                    break;
                }
            }
            if (flag)    cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            bool flag = false;
            for (int i = 1; i <= sqrt(n); i++) {
                int j = (d + i) / (i + 1);
                int h = i + j;
                if (h <= n) {
                    flag = true;
                    break;
                }
            }
            if (flag)    cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            bool flag = false;
            for (int i = 1; i <= d / 2 + 1; i++) {
                int h = i + ceil((double)d / (i + 1));
                if (h <= n) {
                    flag = true;
                    break;
                }
            }
            if (flag)    cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            bool ans = false;
            for (int x = 1; x < n; x++) {
                int h = d / (x + 1);
                if (d % (x + 1)) h++;
                if (x + h <= n) {
                    ans = true;
                    break;
                }
            }
            if (ans) cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            bool flag = false;
            for (int i = 1; i <= sqrt(n); i++) {
                int h = i + ceil((double)d / (i + 1));
                if (h <= n) {
                    flag = true;
                    break;
                }
            }
            if (flag)    cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            bool flag = false;
            for (int i = 1; i <= sqrt(n); i++) {
                int j = d / (i + 1);
                if (d % (i + 1) != 0)    j++;
                int h = i + j;
                if (h <= n) {
                    flag = true;
                    break;
                }
            }
            if (flag)    cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            int x = ceil(2 * sqrt(d) - 1);
            if (x <= n)  cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define EPS             1e-9

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

void swap(int* x, int* y) {
    int temp = *x;
    *x = *y;
    *y = temp;
}

string dig[] = {
    "1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"
};

int minsteps(string s, int& k) {
    int mi = INT_MAX;
    int ans = -1;
    for (int i = 0; i < 10; i++) {
        int c = 0;
        for (int j = 0; j < 7; j++) {
            if (s[j] != dig[i][j]) c++;
        }
        // cout << c << endl;
        if (c <= mi) {
            mi = c;
            ans = i;
        }
    }
    if (mi <= k) {
        k -= mi;
        return ans;
    } else   return -1;
}

int32_t main()
{
    c_p_c();
    w(t) {
        int n, d; cin >> n >> d;
        if (d <= n) {
            cout << "YES\n";
        } else {
            bool ans = false;
            for(int i = 1; i < n; i++){
                int h = d / (x + 1);
                if(d % (x + 1)) h++;
                if(x + h <= n){
                    ans = true;
                    break;
                }
            }
            if(ans) cout << "YES\n";
            else    cout << "NO\n";
        }
    }
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e18
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll n, d;
    cin >> n >> d;
    for(ll i = 0; i * i <= d; ++i){
        if(i + up(d, i + 1) <= n){
            cotu << yes << endl;
            return;
        }
    }
    cout << no << endl;
    return;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e18
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll n, d;
    cin >> n >> d;
    bool flag = false;
    for(ll i = 0; i <= sqrt(n) + 100; ++i){
        if(i + up(d, i + 1) <= n){
            flag = true;
            break;
        }
    }
    if(flag)
        cout << yes << endl;
    else
        cout << no << endl;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e18
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll n, d;
    cin >> n >> d;
    bool flag = false;
    for(ll i = 0; i * i <= n; ++i){
        if(i + up(d, i + 1) <= n){
            flag = 1;break;
        }
    }
    if(flag)
        cout << yes << endl;
    else
        cout << no << endl;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e16
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll d, n;
    cin >> n >> d;
    ll l = 0, r = INF;
    while(l + 1 < r){
        ll mid = (l + r) >> 1;
        if(up(d, mid + 1) + mid <= n)
            l = mid;
        else
            r = mid;
    }
    if(l + up(d, l + 1) <= n)
        cout << yes << endl;
    else
        cout << no << endl;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e16
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll d, n;
    cin >> n >> d;
    ll l = 0, r = 1000000000000;
    while(l + 1 < r){
        ll mid = (l + r) >> 1;
        if(up(d, mid + 1) + mid <= n)
            l = mid;
        else
            r = mid;
    }
    if(l + up(d, l + 1) <= n)
        cout << yes << endl;
    else
        cout << no << endl;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e16
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll d, n;
    cin >> n >> d;
    ll l = 0, r = INF;
    while(l + 1 < r){
        ll mid = (l + r) >> 1;
        if(up(d, mid + 1) + mid <= n)
            l = mid;
        else
            r = mid;
    }

    ll lst = l;
    l = max(0LL, l - 10);

    bool flag = false;
    while(l < lst + 10 and !flag){
        if(up(d, l + 1) + l <= n){
            flag = 1;
            break;
        }

        ++l;
    }

    if(flag)
        cout << yes << endl;
    else
        cout << no << endl;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e18
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll d, n;
    cin >> n >> d;
    if((ll)(n / 2) + up(d, (ll)(n / 2) + 1) <= n)
        cout << yes << endl;
    else
        cout << no << endl;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e18
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll n, d;
    cin >> n >> d;
    bool flag = false;
    for(ll i = 0; i <= sqrt(n); ++i){
        if(i + up(d, i + 1) <= n){
            flag = true;
            break;
        }
    }
    if(flag)
        cout << yes << endl;
    else
        cout << no << endl;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e18
#define MOD (ll)1e9

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

void solve(){
    ll n, d;
    cin >> n >> d;
    for(ll i = 0; i * i <= d; ++i){
        if(i + up(d, i + 1) <= n){
            cout << yes << endl;
            return;
        }
    }
    cout << no << endl;
    return;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    // t = 1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;

#define P pair
typedef P < int, int > Pii;
typedef P < ll, ll > Pll;
typedef P < string, string > Pss;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define fore(i, a) for(auto (i) : (a))

#define add_fill(a, c) setw(a) << setfill(c)
#define endl '\n'

#define slimming(a) a.shrink_to_fit()
#define len(a) (ll)a.size()
#define check(a) next_permutation(all(a))

#define f first
#define s second

// #define ff f.f
// #define fs f.s
// #define sf s.f
// #define ss s.s

#define INF 1e18
#define MOD (1000000007)

#define yes "YES"
#define no "NO"

#define pb push_back
#define eb emplace_back

// ||           ----   ||
// ||          /    \  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||          |    |  ||
// ||_______   |    |  ||_______
// \\_______|  \____/  \\_______|

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

ll get_rand(){
    return ((rand() << 15) ^ rand());
}

ll up(ll a, ll c){
    return (ll)((a + c - 1) / c);
}

ll a[11][1001];
ll b[11][1001];
void solve(){
    ll n, m;
    cin >> n >> m;

    for(int i = 1; i <= n; ++i){
        a[0][i - 1] = n - i + 1;
    }

    for(int i = 1; i < m; ++i){
        for(int j = 0; j < n; ++j){
            ll sm = 0;

            for(int k = 0; k <= j; ++k){
                sm = (sm + a[i - 1][k]) % MOD;
                // cout << a[i - 1][k] << ' ';
            }
            // cout << " : " << sm << "std::endl;\n";
            a[i][j] += sm;
            a[i][j] %= MOD;
        }
    }

    ll sm = 0;
    // for(int i = 0; i < m; ++i){
    //     for(int j=0; j < n; ++j){
    //         cout << a[i][j] << ' ';
    //     }
    //     cout << endl;
    // }

    for(int i = 0; i < n; ++i)
        sm = (sm + a[m - 1][i]) % MOD;
    cout << sm % MOD;
}
int main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);

    // freopen("input.txt", "r", stdin);

    // freopen("delivery.in", "r", stdin);
    // freopen("delivery.out", "w", stdout);
    ll t;
    t = 1;
    // cin >> t;
    while(t--)
        solve();
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int func(int d, int x) {
	return x + ceil(d * 1.0 / (x + 1));
}

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;

		int left = 0, right = n;
		while (right - left >= 3) {
			int m1 = (left * 2 + right) / 3;
			int m2 = (left + 2 * right) / 3;

			if (func(d, m1) < func(d, m2))
				right = m2;
			else
				left = m1;
		}

		cout << left << '\n';
		if (func(d, left) <= n || func(d, left - 1) <= n || func(d, left - 2) <= n)
			cout << "YES" << '\n';
		else
			cout << "NO" << '\n';
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int func(int d, int x) {
	return x + ceil(d * 1.0 / (x + 1));
}

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;

		int left = 0, right = n;
		while (right - left >= 3) {
			int m1 = (left * 2 + right) / 3;
			int m2 = (left + 2 * right) / 3;

			if (func(d, m1) < func(d, m2))
				left = m1;
			else
				right = m2;
		}

		if (func(d, left) <= n || func(d, left + 1) <= n || func(d, left + 2) <= n)
			cout << "YES" << '\n';
		else
			cout << "NO" << '\n';
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int func(int d, int x) {
	return ceil(x + d * 1.0 / (x + 1));
}

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;

		double left = 0, right = n;
		while (right - left >= 100) {
			int m1 = (left * 2 + right) / 3;
			int m2 = (left + 2 * right) / 3;

			if (func(d, m1) < func(d, m2))
				right = m2;
			else
				left = m1;
		}

		int flag = 1;
		for (int i = left; i < left + 100; ++i)
			if (func(d, i) <= n) {
				cout << "YES" << '\n';
				flag = 0;
				break;
			}
		if (flag)
			cout << "NO" << '\n';
	}

	return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;
		if (d <= n) {
			cout << "YES" << endl;
			continue;
		}
		bool flag = false;
		int x = sqrt(d);
		for (int i = 1; i <= (x + 1) * 2 && i <= d; ++i)
			if (i + ceil(d / i) <= n) {
				flag = true;
				break;
			}
		if (flag)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int func(int d, int x) {
	return ceil(x + d * 1.0 / (x + 1));
}

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;

		double left = 0, right = n;
		while (right - left >= 5) {
			int m1 = (left * 2 + right) / 3;
			int m2 = (left + 2 * right) / 3;

			if (func(d, m1) < func(d, m2))
				right = m2;
			else
				left = m1;
		}

		int flag = 1;
		for (int i = left; i < left +5; ++i)
			if (func(d, i) <= n) {
				cout << "YES" << '\n';
				flag = 0;
				break;
			}
		if (flag)
			cout << "NO" << '\n';
	}

	return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int n, d;
int f(int m) {
	return m + ceil(d / m);
}

int main()
{
	int t;
	cin >> t;
	while (t--) {

		cin >> n >> d;
		if (d <= n) {
			cout << "YES" << endl;
			continue;
		}
		bool flag = false;
		int x = sqrt(d);
		for (int i = 1; i <= x + 10 && i <= d; ++i)
			if (i + ceil((double)d / (i + 1)) <= n) {
				//cout << i << endl;
				flag = true;
				break;
			}
		if (flag)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int func(int d, int x) {
	return ceil(x + d * 1.0 / (x + 1));
}

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;

		double left = 0, right = n;
		while (right - left > 5) {
			int m1 = (left * 2 + right) / 3;
			int m2 = (left + 2 * right) / 3;

			if (func(d, m1) < func(d, m2))
				right = m2;
			else
				left = m1;
		}

		int flag = 1;
		for (int i = left; i < left +5; ++i)
			if (func(d, i) <= n) {
				cout << "YES" << '\n';
				flag = 0;
				break;
			}
		if (flag)
			cout << "NO" << '\n';
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int func(int d, int x) {
	return x + ceil(d * 1.0 / (x + 1));
}

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;

		int left = 0, right = n;
		while (right - left >= 3) {
			int m1 = (left * 2 + right) / 3;
			int m2 = (left + 2 * right) / 3;

			if (func(d, m1) < func(d, m2))
				right = m2;
			else
				left = m1;
		}

		if (func(d, left) <= n || func(d, left + 1) <= n || func(d, left + 2) <= n)
			cout << "YES" << '\n';
		else
			cout << "NO" << '\n';
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int func(int d, int x) {
	return x + ceil(d * 1.0 / (x + 1));
}

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;

		int left = 0, right = n;
		while (right - left >= 3) {
			int m1 = (left * 2 + right) / 3;
			int m2 = (left + 2 * right) / 3;

			if (func(d, m1) < func(d, m2))
				right = m2;
			else
				left = m1;
		}

		if (func(d, left) <= n || func(d, left - 1) <= n || func(d, left - 2) <= n)
			cout << "YES" << '\n';
		else
			cout << "NO" << '\n';
	}

	return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n, d;
		cin >> n >> d;
		if (d <= n) {
			cout << "YES" << endl;
			continue;
		}
		bool flag = false;
		int x = sqrt(d);
		for (int i = 1; i <= x + 1; ++i)
			if (i + ceil(d / i) <= n) {
				flag = true;
				break;
			}
		if (flag)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    return x+((d+x)/(x+1));
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        ll low = 0;
        ll high = n;
        while(high-low>=100){
            ll m1 = (2*low+high)/3;
            ll m2 = (low+2*high)/3;
            if(check(m1, d)<check(m2, d)){
                high = m2;
            }
            else{
                low = m1;
            }
        }
        ll minVal=INT_MAX;
        for(ll i=low; i<=high; i++){
            ll val = i+((d+i)/(i+1));
            minVal = min(minVal, val);
        }
        if(minVal<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    return x+((d+x)/(x+1));
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        ll low = 0;
        ll high = n;
        while(high-low+1>=3){
            ll m1 = (2*low + high)/3;
            ll m2 = (low+2*high)/3;
            if(check(m1, d)<check(m2, d)){
                low = m1;
            }
            else{
                high = m2;
            }
        }
        ll minVal=INT_MAX;
        for(ll i=low; i<=high; i++){
            ll val = i+((d+i)/(i+1));
            minVal = min(minVal, val);
        }
        if(minVal<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    return x+((d+x)/(x+1));
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        ll low = 0;
        ll high = n;
        while(high-low>=3){
            ll m1 = (2*low+high)/3;
            ll m2 = (low+2*high)/3;
            if(check(m1, d)<check(m2, d)){
                high = m2;
            }
            else{
                low = m1;
            }
        }
        ll minVal=INT_MAX;
        for(ll i=low; i<=high; i++){
            ll val = i+((d+i)/(i+1));
            minVal = min(minVal, val);
        }
        if(minVal<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    return x+((d+x)/(x+1));
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        ll low = 0;
        ll high = n;
        while(high-low>=20){
            ll m1 = (2*low+high)/3;
            ll m2 = (low+2*high)/3;
            if(check(m1, d)<check(m2, d)){
                high = m2;
            }
            else{
                low = m1;
            }
        }
        ll minVal=INT_MAX;
        for(ll i=low; i<=high; i++){
            ll val = i+((d+i)/(i+1));
            minVal = min(minVal, val);
        }
        if(minVal<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    return x+((d+x)/(x+1));
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        ll low = 0;
        ll high = n;
        while(high-low>=10){
            ll m1 = (2*low+high)/3;
            ll m2 = (low+2*high)/3;
            if(check(m1, d)<check(m2, d)){
                high = m2;
            }
            else{
                low = m1;
            }
        }
        ll minVal=INT_MAX;
        for(ll i=low; i<=high; i++){
            ll val = i+((d+i)/(i+1));
            minVal = min(minVal, val);
        }
        if(minVal<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    ll ans = x+((d+x)/(x+1));
    return ans;
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        double lowerLimit = sqrt(d)-1;
        ll low = (ll)lowerLimit;
        ll high = (ll)ceil(lowerLimit);
        if(check(high, d)<=n ||check(low, d)<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    return x+((d+x)/(x+1));
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        ll low = 0;
        ll high = n;
        while(high-low>=3){
            ll m1 = (2*low+high)/3;
            ll m2 = (low+2*high)/3;
            if(check(m1, d)<check(m2, d)){
                low = m1;
            }
            else{
                high = m2;
            }
        }
        ll minVal=INT_MAX;
        for(ll i=low; i<=high; i++){
            ll val = i+((d+i)/(i+1));
            minVal = min(minVal, val);
        }
        if(minVal<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    return x+((d+x)/(x+1));
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        ll low = 0;
        ll high = 1000000000;
        while(high-low>=10){
            ll m1 = (2*low+high)/3;
            ll m2 = (low+2*high)/3;
            if(check(m1, d)<check(m2, d)){
                high = m2;
            }
            else{
                low = m1;
            }
        }
        ll minVal=INT_MAX;
        for(ll i=low; i<=high; i++){
            ll val = i+((d+i)/(i+1));
            minVal = min(minVal, val);
        }
        if(minVal<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll check(ll x, ll d){
    return x+((d+x)/(x+1));
}

int main(){
    cpp();
    w(T){
        ll n, d;
        cin>>n>>d;
        ll low = 0;
        ll high = n;
        while(high-low>=11){
            ll m1 = (2*low+high)/3;
            ll m2 = (low+2*high)/3;
            if(check(m1, d)<check(m2, d)){
                high = m2;
            }
            else{
                low = m1;
            }
        }
        ll minVal=INT_MAX;
        for(ll i=low; i<=high; i++){
            ll val = i+((d+i)/(i+1));
            minVal = min(minVal, val);
        }
        if(minVal<=n){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define pi  3.14159265359
#define mod 1000000007

int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       ll n,x;
       cin>>n>>x;
       if(x<=n||x<=(n*2)-2){
        cout<<"YES\n";
       }else{
       cout<<"NO\n";
       }
   }

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define pi  3.14159265359
#define mod 1000000007

int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       ll n,d;
       cin>>n>>d;
       if(n>=d){
        cout<<"YES\n"; continue;
       }
       int x=1;
       bool ok=true;
       while(x<sqrt(d))
       {
           int plu=0;
           if(d%(x+1)!=0)plu=1;
           if(x+(d/(x+1))+plu<=n){
            cout<<"YES\n";
            ok=false;
            break;
           }
           x++;
       }
       if(ok){
        cout<<"NO\n";
       }
   }

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define pi  3.14159265359
#define mod 1000000007

int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       ll n,d;
       cin>>n>>d;
       if(n>=d){
        cout<<"YES\n"; continue;
       }
       int x=1;
       bool ok=true;
       while(true)
       {
           int plu=0;
           if(d/(x+1)!=0)plu=1;
           if(x+(d/(x+1))+plu<=n){
            cout<<"YES\n";
            ok=false;
            break;
           }
            if(d/(x+1)==0){
            break;
           }
           x++;
       }
       if(ok){
        cout<<"NO\n";
       }
   }

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define pi  3.14159265359
#define mod 1000000007

int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       ll n,d;
       cin>>n>>d;
       if(n>=d){
        cout<<"YES\n";
        continue;
       }
       int x=1;
       bool ok=true;
       while(d)
       {
           int plu=0;
           if(d/(x+1)!=0)plu=1;
           if(x+(d/(x+1)+plu)<=n){
            cout<<"YES\n";
            ok=false;
            break;
           }
           x++;
           if(d/(x+1)==0){
            break;
           }
       }
       if(ok){
        cout<<"NO\n";
       }
   }

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define pi  3.14159265359
#define mod 1000000007

int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       ll n,x;
       cin>>n>>x;

       if(x>((n*2)-2)){
        cout<<"NO\n";
       }else{
       cout<<"YES\n";
       }
   }

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define pi  3.14159265359
#define mod 1000000007

int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       ll n,x;
       cin>>n>>x;
       if(x<=n||x<=(n*2)){
        cout<<"YES\n";
       }else{
       cout<<"NO\n";
       }
   }

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define pi  3.14159265359
#define mod 1000000007

int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       ll n,d;
       cin>>n>>d;
       if(n>=d){
        cout<<"YES\n"; continue;
       }
       int x=1;
       bool ok=true;
       while(x<sqrt(d))
       {
           int plu=0;
           if(d/(x+1)!=0)plu=1;
           if(x+(d/(x+1))+plu<=n){
            cout<<"YES\n";
            ok=false;
            break;
           }
           x++;
       }
       if(ok){
        cout<<"NO\n";
       }
   }

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define pi  3.14159265359
#define mod 1000000007

int main()
{
   int t;
   cin>>t;
   while(t--)
   {
       ll n,d;
       cin>>n>>d;
       if(n>=d){
        cout<<"YES\n"; continue;
       }
       int x=1;
       bool ok=true;
       while(x<n)
       {
           int plu=0;
           if(d/(x+1)!=0)plu=1;
           if(x+(d/(x+1))+plu<=n){
            cout<<"YES\n";
            ok=false;
            break;
           }
           x++;
       }
       if(ok){
        cout<<"NO\n";
       }
   }

}


#include<bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define int         ll int
#define	endl		'\n'
#define mii         map<int,int>
#define msi         map<string,int>
#define mis         map< int, string>
#define mpi         map<pair< int, int>, int>
#define pii         pair< int, int>
#define vi          vector< int>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;

#define N  100005

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
    	int n,d;
    	int i,j,k;
    	cin>>n>>d;
    	if(d<=n)
    	{
    		cout<<"YES"<<endl;
    		continue;
		}
		else
		{
			int c=0;
			for(i=0;i<=d;i++)
			{
				//cout<<i<<" "<<ceil((float)d/(i+1))<<endl;
				if((i+1)*(i+1)>=d)
				{
					break;
				}
			}
			if(i+ceil((double)d/(i+1))<=n)
			{
				cout<<"YES"<<endl;
			}
			else
			{
				cout<<"NO"<<endl;
			}

		}
	}
}


#include<bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define int         ll int
#define	endl		'\n'
#define mii         map<int,int>
#define msi         map<string,int>
#define mis         map< int, string>
#define mpi         map<pair< int, int>, int>
#define pii         pair< int, int>
#define vi          vector< int>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;

#define N  100005

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
    	int n,d;
    	cin>>n>>d;
    	if(d<=n)
    	{
    		cout<<"YES"<<endl;
    		continue;
		}
		else
		{
			if(1+ceil((float)d/(2))<=n)
			{
				cout<<"YES"<<endl;
			}
			else
			{
				cout<<"NO"<<endl;
			}
		}
	}
}


#include<bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define int         ll int
#define	endl		'\n'
#define mii         map<int,int>
#define msi         map<string,int>
#define mis         map< int, string>
#define mpi         map<pair< int, int>, int>
#define pii         pair< int, int>
#define vi          vector< int>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;

#define N  100005

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
    	int n,d;
    	int i,j,k;
    	cin>>n>>d;
    	if(d<=n)
    	{
    		cout<<"YES"<<endl;
    		continue;
		}
		else
		{
			int c=0;
			for(i=0;i<=d;i++)
			{
				//cout<<i<<" "<<ceil((float)d/(i+1))<<endl;
				if(i==ceil((float)d/(i+1)))
				{
					break;
				}
			}
			if(2*i<=n)
			{
				cout<<"YES"<<endl;
			}
			else
			{
				cout<<"NO"<<endl;
			}

		}
	}
}


#include<bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define int         ll int
#define	endl		'\n'
#define mii         map<int,int>
#define msi         map<string,int>
#define mis         map< int, string>
#define mpi         map<pair< int, int>, int>
#define pii         pair< int, int>
#define vi          vector< int>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;

#define N  100005

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
    	int n,d;
    	int i,j,k;
    	cin>>n>>d;
    	if(d<=n)
    	{
    		cout<<"YES"<<endl;
    		continue;
		}
		else
		{
			int c=0;
			for(i=0;i<=d;i++)
			{
				//cout<<i<<" "<<ceil((float)d/(i+1))<<endl;
				if((i+1)*(i+1)>=d)
				{
					break;
				}
			}
			if(i+ceil((float)d/(i+1))<=n)
			{
				cout<<"YES"<<endl;
			}
			else
			{
				cout<<"NO"<<endl;
			}

		}
	}
}


#include<bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define int         ll int
#define	endl		'\n'
#define mii         map<int,int>
#define msi         map<string,int>
#define mis         map< int, string>
#define mpi         map<pair< int, int>, int>
#define pii         pair< int, int>
#define vi          vector< int>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;

#define N  100005
int min(int a,int b)
{
	if(a>=b)
	{
		return b;
	}
	else
	{
		return a;
	}
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t;
	cin>>t;
	while(t--)
	{
	    int n,d;
	    cin>>n>>d;
	    int i,j,k;
	    int a=sqrt(d);
	    int ans=INT_MAX;
	    for(i=0;i<=a+1;i++)
	    {
	    	ans=min(ans,i+ceil((float)d/(i+1)));
		}
		if(ans<=n)
		{
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
    }
}