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

using namespace __gnu_pbds;
using namespace std;

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

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

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

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

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

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

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

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

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

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

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

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

    return 0;
}


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

using namespace __gnu_pbds;
using namespace std;

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

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

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

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

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

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

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

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

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

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

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

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

    return 0;
}


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

using namespace __gnu_pbds;
using namespace std;

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

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

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

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

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

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

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

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

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

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

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

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

    return 0;
}*/

///Math
int main()
{
    faster
    int t,x,y,r;
    cin>>t;
    while(t--)
    {
        cin>>x>>y;
        r=sqrt(y);
        if((r-1+(y+r-1)/r)<=x)
            cout<<"yes\n";
        else
            cout<<"no\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define Start ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define fr first
#define sc second
#define PI 3.14159265
#define ullt unsigned long long int
using namespace std;

int main()
{
    Start;
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        bool ok=false;
        int x=1;
        if(n==d)
            ok=true;
        while(x<=1e5&&!ok)
        {
            ll num=(x*x)+x-x*n+d-n+1;
            if(num==0)
            ok=true;

            x++;
        }
        if(!ok)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }
}


#include <bits/stdc++.h>
#define ll long long
#define Start ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define fr first
#define sc second
#define PI 3.14159265
#define ullt unsigned long long int
using namespace std;

int main()
{
    Start;
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        if(sqrt((1-n)*(1-n)-4*(d-n))>=0)
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
#define ll long long
#define Start ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define fr first
#define sc second
#define PI 3.14159265
#define ullt unsigned long long int
using namespace std;

int main()
{
    Start;
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        ullt a=(1-n)*(1-n);
        ullt b=4*(d-n);
        if(sqrt(a-b)>=0)
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
#define ll long long
#define Start ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define fr first
#define sc second
#define PI 3.14159265
#define ullt unsigned long long int
using namespace std;

int main()
{
    Start;
    int t;
    cin>>t;
    while(t--)
    {
        ll n,d;
        cin>>n>>d;
        ll a=(1-n)*(1-n);
        ll b=4*(d-n);
        if(sqrt(a-b)>=0)
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
#define ll long long
#define Start ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define fr first
#define sc second
#define PI 3.14159265
#define ullt unsigned long long int
using namespace std;

int main()
{
    Start;
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        bool ok=false;
        int x=1;
        if(n==d)
            ok=true;
        while(x<=sqrt(n)&&!ok)
        {
            ll num=(x*x)+x-x*n+d-n+1;
            if(num==0)
            ok=true;

            x++;
        }
        if(!ok)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }
}


#include <bits/stdc++.h>
#define ll long long
#define Start ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define fr first
#define sc second
#define PI 3.14159265
#define ullt unsigned long long int
using namespace std;

int main()
{
    Start;
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        bool ok=false;
        int x=1;
        if(n==d)
            ok=true;
        while(x<=1e5&&!ok)
        {
            ullt num=(x*x)+x-x*n+d-n+1;
            if(num==0)
            ok=true;

            x++;
        }
        if(!ok)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }
}


#include <bits/stdc++.h>
#define ll long long
#define Start ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define fr first
#define sc second
#define PI 3.14159265
#define ullt unsigned long long int
using namespace std;

int main()
{
    Start;
    int t;
    cin>>t;
    while(t--)
    {
        int n,d;
        cin>>n>>d;
        ll a=(1-n)*(1-n);
        ll b=4*(d-n);
        if(sqrt(a-b)>=0)
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll t,n,d;
    cin>>t;

    while(t--)
    {

        cin>>n>>d;

        if(d<= n)
            cout<<"YES"<<endl;
        else{
            ll rt = sqrt(d);
            bool ck=false;
            for(ll i = 1; i <= rt; i++){
                ll ans = i + ceil((double)d/(double)(i+1));
                if(ans<=n)
                {
                   ck=true;
                    break;
                }
            }
            if(ck==true)
                cout<<"YES"<<endl;
            else
            cout<<"NO"<<endl;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll n,d,t,rt,i,ans;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        if(d <= n)
            cout<<"YES"<<endl;
        else {
        rt = sqrt(n); bool ck=false;
        for(i=1; i <= rt; i++)
        {
           ans = i + ceil((double)d/(double)(i+1));
           if(ans<=n)
           {
               ck=true;
               break;
           }
        }
        if(ck==true)
            cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll t,n,d,ans,rt,i;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        if(d <= n)
            cout<<"YES"<<endl;
        else {
            rt = sqrt(n); bool ck=false;
        for(i=1; i <= rt; i++)
        {
           ans = i + ceil((double)d/(double)(i+1));
           if(ans<=n)
           {
               ck=true;
               break;
           }
        }
            if(ck==true)
                cout<<"YES"<<endl;
            else
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,d,t;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        bool ck=false;
        int  x=sqrt(n);
        int i,ans;
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }

        for(i=1; i<=x; i++)
        {
           ans = i+ceil((double)d/(i+1));

          if(ans<=n)
           {

               cout<<"YES"<<endl;
               ck=true;
               break;
           }
        }
        if(ck==false)
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int  n,d,t;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        bool ck=false;
        long long int   x=sqrt(n);
        long long int i,ans;
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }

        for(i=1; i<=x; i++)
        {
           ans = i+ceil((double)d/(double)(i+1));

          if(ans<=n)
           {

               cout<<"YES"<<endl;
               ck=true;
               break;
           }
        }
        if(ck==false)
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int  n,d,t;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;

        long long int i,ans;
        if(d <= n)
        {
            cout<<"YES"<<endl;

        }
        else {
                long long int   x = sqrt(n);
        bool ck=false;
        for(i=1; i<= x; i++)
        {
           ans = i+ceil((double)d/(double)(i+1));

          if(ans<=n)
           {
               ck=true;
               break;
           }
        }
        if(ck==true)
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int  n,d,t;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        bool ck=false;

        long long int i,ans;
        if(d <= n)
        {
            cout<<"YES"<<endl;

        }
        else {
                long long int   x = sqrt(n);
        for(i=1; i<= x; i++)
        {
           ans = i+ceil((double)d/(double)(i+1));

          if(ans<=n)
           {
               ck=true;
               break;
           }
        }
        if(ck==true)
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll t,n,d,ans,rt,i;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        if(d<=n)
            cout<<"YES"<<endl;
        else{
            rt = sqrt(d);
            bool ck=false;
            for( i = 1; i<=rt; i++){
                ans = i + ceil((double)d/(double)(i+1));
                if(ans<=n)
                {
                   ck=true;
                    break;
                }
            }
            if(ck==true)
                cout<<"YES"<<endl;
            else
            cout<<"NO"<<endl;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll n,d,t,rt,i;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        if(d <= n)
        {
            cout<<"YES"<<endl;

        }
        else {
        rt = sqrt(n);
        bool ck=false;
        for(i=1; i <= rt; i++)
        {
           ll ans = i+ceil((double)d/(double)(i+1));

          if(ans<=n)
           {
               ck=true;
               break;
           }
        }
        if(ck==true)
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll t,n,d,ans,rt,i;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        if(d <= n)
            cout<<"YES"<<endl;
        else {
           rt = sqrt(d); bool ck=false;
            for( i = 1; i<=rt; i++){
                ans = i + ceil((double)d/(double)(i+1));
                if(ans<=n)
                {
                   ck=true;
                    break;
                }
            }
            if(ck==true)
                cout<<"YES"<<endl;
            else
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


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

/*-------------------------- HRIDOY ROY -------------------------*/

#define     fRead           freopen("input.txt","r",stdin)
#define     fWrite          freopen("output.txt","w",stdout)

#define     I(X)            scanf("%d",&(X))
#define     II(X, Y)        scanf("%d%d",&(X),&(Y))
#define     III(X,Y,Z)      scanf("%d%d%d",&(X),&(Y),&(Z))
#define     IL(X)           scanf("%lld",&(X))
#define     IIL(X, Y)       scanf("%lld%lld",&(X),&(Y))
#define     pb              push_back
#define     popb            pop_back
#define     lld             long long int
#define     ull             unsigned long long int
#define     max3(a,b,c)     max(a,max(b,c))
#define     max4(a,b,c,d)   max(max3(a,b,c),d)
#define     min3(a,b,c)     min(a,min(b,c))
#define     min4(a,b,c,d)   min(a,min3(b,c,d))
#define     MOD             1000000007
#define     f               first
#define     s               second
#define     mem(a,v)        memset(a,v,sizeof(a))
#define     mp              make_pair

#define     show            printf("---***---")
#define     all(v)          v.begin(),v.end()
#define     fast            ios_base::sync_with_stdio(0);cin.tie(0)
#define     pii             pair<int,int>
#define     PLL             pair<lld,lld>
#define     MAX             100000000000014
#define     MIN             -100000000000014
#define     gti             greater<int>
#define     gtL             greater<lld>
#define     PI1             acos(-1.0)
#define     pi2             2.0*acos(0.0)
#define     endl            '\n'

//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move

//int Set(int N,int pos){return N=N | (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
//__builtin_popcount // back_inserter() // stoll
// priority_queue<pii,vector<pii>,greater<pii> >q;
//priority_queue<string,vector<pair<string,int>>,greater<pair<string,int>> >q;
//priority_queue<int, vector<int>, greater<int> >pq; // DSCS;
//priority_queue<int, vector<int>, less<int> >pq; // INCS;

int Day12[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int prime100[]={2, 3, 5, 7, 11, 13, 17, 19, 23,29,31, 37, 41, 43, 47, 53, 59,61, 67,71, 73, 79, 83, 89, 97, 101, 103 };
//unsigned long long int phi[5000005]; // count relatively prime for 1 to n//
//void MYFHI(){lld max = 5000001;phi[1]=1;for(lld i=2;i<max;i++){ if(phi[i]==0){ phi[i]=i-1;for(lld j=i*2;j<max;j=j+i){ if(phi[j]==0) phi[j]=j;phi[j]=phi[j]-(phi[j]/i);}}}}
/*
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace __gnu_pbds;
template <typename T> using orderset = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
orderset <int> os;
int kth = *os.find_by_order(K - 1);
*/
template <typename T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false);}
template <typename T> inline T GCD (T a,T b ) {a = abs(a);b = abs(b); if(a < b) swap(a, b); while ( b ) { a = a % b; swap ( a, b ); } return a;}
template <typename T> inline T LCM(T x,T y){T tp = GCD(x,y);if( (x / tp) * 1. * y > 9e18) return 9e18;return (x / tp) * y;}
template <typename T> inline T BIGMOD(T A,T B,T M = MOD){T ret = 1;while(B){if(B & 1) ret = (ret * A) % M;A = (A * A) % M;B = B >> 1;}return ret;}
template <typename T> inline T BigMod(T A,T B,T M){T ret = 1;while(B){if(B & 1) ret = (ret * A) % M;A = (A * A) % M;B = B >> 1;}return ret;}
lld MySqrt(lld n){lld p=sqrt(n);if((p+1)*(p+1)<=n) return p+1;else if(p*p<=n) return p;else return p-1;}
lld MyPow(lld x, lld n){if(n==0) return 1; else if(n%2==0) return MyPow(x*x,n/2); else return x*MyPow(x*x,((n-1)/2));}
lld modInverse(lld n){ return BIGMOD(n,(lld)MOD-2)%MOD;}

//----------------------------- O.D.Y.W.F.M ----------------------------------//
#define ll long long int
int main()
{
    int T;
    cin>>T;

    while(T--)
    {
        ll N,D;
        cin>>N>>D;

        if(D <= N)
            printf("YES\n");
        else{
            ll rt = sqrt(D) , flag = 0;
            for(ll i = 1; i <= rt; i++){
                ll ans = i + ceil((double)D/(double)(i+1));
                if(ans <= N)
                {
                    flag = 1;
                    break;
                }
            }
            if(flag == 1)
                printf("YES\n");
            else
            printf("NO\n");
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll n,d,t,rt,i;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        if(d <= n)
        {
            cout<<"YES"<<endl;

        }
        else {
        rt = sqrt(n);
        bool ck=false;
        for(i=1; i <= rt; i++)
        {
           ll ans = i + ceil((double)d/(double)(i+1));

          if(ans<=n)
           {
               ck=true;
               break;
           }
        }
        if(ck==true)
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int  n,d,t;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        bool ck=false;
        long long int   x=sqrt(n);
        long long int i,ans;
        if(d<=n)
        {
            cout<<"YES"<<endl;

        }
        else {
        for(i=1; i<=x; i++)
        {
           ans = i+ceil((double)d/(i+1));

          if(ans<=n)
           {
               ck=true;
               break;
           }
        }
        if(ck==true)
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,d,t;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        bool ck=false;
        int  x=sqrt(n);
        int i,ans;
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }

        for(i=1; i<=x; i++)
        {
           ans = i+ceil((double)d/(double)(i+1));

          if(ans<=n)
           {

               cout<<"YES"<<endl;
               ck=true;
               break;
           }
        }
        if(ck==false)
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


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

/*-------------------------- HRIDOY ROY -------------------------*/

#define     fRead           freopen("input.txt","r",stdin)
#define     fWrite          freopen("output.txt","w",stdout)

#define     I(X)            scanf("%d",&(X))
#define     II(X, Y)        scanf("%d%d",&(X),&(Y))
#define     III(X,Y,Z)      scanf("%d%d%d",&(X),&(Y),&(Z))
#define     IL(X)           scanf("%lld",&(X))
#define     IIL(X, Y)       scanf("%lld%lld",&(X),&(Y))
#define     pb              push_back
#define     popb            pop_back
#define     lld             long long int
#define     ull             unsigned long long int
#define     max3(a,b,c)     max(a,max(b,c))
#define     max4(a,b,c,d)   max(max3(a,b,c),d)
#define     min3(a,b,c)     min(a,min(b,c))
#define     min4(a,b,c,d)   min(a,min3(b,c,d))
#define     MOD             1000000007
#define     f               first
#define     s               second
#define     mem(a,v)        memset(a,v,sizeof(a))
#define     mp              make_pair

#define     show            printf("---***---")
#define     all(v)          v.begin(),v.end()
#define     fast            ios_base::sync_with_stdio(0);cin.tie(0)
#define     pii             pair<int,int>
#define     PLL             pair<lld,lld>
#define     MAX             100000000000014
#define     MIN             -100000000000014
#define     gti             greater<int>
#define     gtL             greater<lld>
#define     PI1             acos(-1.0)
#define     pi2             2.0*acos(0.0)
#define     endl            '\n'

//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move

//int Set(int N,int pos){return N=N | (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
//__builtin_popcount // back_inserter() // stoll
// priority_queue<pii,vector<pii>,greater<pii> >q;
//priority_queue<string,vector<pair<string,int>>,greater<pair<string,int>> >q;
//priority_queue<int, vector<int>, greater<int> >pq; // DSCS;
//priority_queue<int, vector<int>, less<int> >pq; // INCS;

int Day12[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int prime100[]={2, 3, 5, 7, 11, 13, 17, 19, 23,29,31, 37, 41, 43, 47, 53, 59,61, 67,71, 73, 79, 83, 89, 97, 101, 103 };
//unsigned long long int phi[5000005]; // count relatively prime for 1 to n//
//void MYFHI(){lld max = 5000001;phi[1]=1;for(lld i=2;i<max;i++){ if(phi[i]==0){ phi[i]=i-1;for(lld j=i*2;j<max;j=j+i){ if(phi[j]==0) phi[j]=j;phi[j]=phi[j]-(phi[j]/i);}}}}
/*
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace __gnu_pbds;
template <typename T> using orderset = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
orderset <int> os;
int kth = *os.find_by_order(K - 1);
*/
template <typename T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false);}
template <typename T> inline T GCD (T a,T b ) {a = abs(a);b = abs(b); if(a < b) swap(a, b); while ( b ) { a = a % b; swap ( a, b ); } return a;}
template <typename T> inline T LCM(T x,T y){T tp = GCD(x,y);if( (x / tp) * 1. * y > 9e18) return 9e18;return (x / tp) * y;}
template <typename T> inline T BIGMOD(T A,T B,T M = MOD){T ret = 1;while(B){if(B & 1) ret = (ret * A) % M;A = (A * A) % M;B = B >> 1;}return ret;}
template <typename T> inline T BigMod(T A,T B,T M){T ret = 1;while(B){if(B & 1) ret = (ret * A) % M;A = (A * A) % M;B = B >> 1;}return ret;}
lld MySqrt(lld n){lld p=sqrt(n);if((p+1)*(p+1)<=n) return p+1;else if(p*p<=n) return p;else return p-1;}
lld MyPow(lld x, lld n){if(n==0) return 1; else if(n%2==0) return MyPow(x*x,n/2); else return x*MyPow(x*x,((n-1)/2));}
lld modInverse(lld n){ return BIGMOD(n,(lld)MOD-2)%MOD;}

//----------------------------- O.D.Y.W.F.M ----------------------------------//
#define ll long long int
int main()
{
    int T;
    cin>>T;

    while(T--)
    {
        ll N,D;
        cin>>N>>D;

        if(D <= N)
            printf("YES\n");
        else{
            ll rt = sqrt(D) , flag = 0;
            for(ll i = 1; i <= rt; i++){
                ll ans = i + ceil((double)D/(i+1));
                if(ans <= N)
                {
                    flag = 1;
                    break;
                }
            }
            if(flag == 1)
                printf("YES\n");
            else
            printf("NO\n");
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll t,n,d,ans,rt;
    cin>>t;
    while(t--)
    {

        cin>>n>>d;

        if(d<=n)
            cout<<"YES"<<endl;
        else{
            rt = sqrt(d);
            bool ck=false;
            for(ll i = 1; i<=rt; i++){
                ans = i + ceil((double)d/(double)(i+1));
                if(ans<=n)
                {
                   ck=true;
                    break;
                }
            }
            if(ck==true)
                cout<<"YES"<<endl;
            else
            cout<<"NO"<<endl;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define long long int ll
int main()
{
    ll  n,d,t,rt;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        if(d <= n)
        {
            cout<<"YES"<<endl;

        }
        else {
                rt = sqrt(n);
        bool ck=false;
        for(i=1; i<= rt; i++)
        {
           ll ans = i+ceil((double)d/(double)(i+1));

          if(ans<=n)
           {
               ck=true;
               break;
           }
        }
        if(ck==true)
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long  n,d,t;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        bool ck=false;
        long long   x=sqrt(n);
        long long  i,ans;
        if(d<=n)
        {
            cout<<"YES"<<endl;
            continue;
        }

        for(i=1; i<=x; i++)
        {
           ans = i+ceil((double)d/(double)(i+1));

          if(ans<=n)
           {

               cout<<"YES"<<endl;
               ck=true;
               break;
           }
        }
        if(ck==false)
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d
n++;
if(d<=pow(n/2,2))
cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
	return 0;
}


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d;
if(d<=pow((n+1)/2,2))
cout<<"YES"<<endl
else cout<<"NO"<<endl;
}
	return 0;
}


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d;
if(d<=pow(n/2,2))
cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
	return 0;
}


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d;
if(d<=pow(n/2,2))
cout<<"YES"<<endl
else cout<<"NO"<<endl;
}
	return 0;
}


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d;
for(i=0;i<n;i++)
if(i+ceil(d/(i+1))==n)
{
cout<<"YES"<<endl;
break;
}
if(i==n)
cout<<"NO"<<endl;
}
	return 0;
}


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d;
n++;
if(d<=pow(n/2,2))
cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
	return 0;
}


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d;
for(i=0;i<n;i++)
if(i+ceil(d/i+1)==n)
{
cout<<"YES"<<endl;
break;
}
if(i==n)
cout<<"NO"<<endl;
}
	return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n,d,i,temp,d1,m;
		cin>>n>>d;
		temp=d;
		m=min(d,100000);
		for(i=1;i<m;i++)
			if(i+(d+i)/(i+1)<temp)
				temp=i+(d+i)/(i+1);
		if(temp<=n)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d;
if(d<=pow((n+1)/2,2))
cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
	return 0;
}


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


//#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
//bool compare(string &s1,string &s2)
//{
//    return s1.size() < s2.size();
//}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
long long int n,d,i;
cin>>n>>d;
for(i=0;i<n;i++)
if(i+ceil(d/(i+1)==n)
{
cout<<"YES"<<endl;
break;
}
if(i==n)
cout<<"NO"<<endl;
}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		long long n, d;
		cin >> n >> d;
		cout << (4*d<=(n+1)*(n+1)? "YES\n": "NO\n");
	}
}


#include <bits/stdc++.h>
using namespace std;
long long F(long long x, long long d){
	return x+(d+x)/(x+1);
}
bool Binary_search(long long l, long long r, long long n, long long d){
	if(r-l<=1){
		if(F(r, d)<=n || F(l, d)<=n) return true;
		return false;
	}
	long long m=(l+r/2);
	if(F(m, d)>n) return Binary_search(l, m, n, d);
	return true;
}
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		long long n, d;
		cin >> n >> d;
		cout << (Binary_search(0, n, n, d)==true? "YES\n": "NO\n");
	}
}


#include <bits/stdc++.h>
using namespace std;
long long F(long long x, long long d){
	return x+(d+x)/(x+1);
}
bool Binary_search(long long l, long long r, long long n, long long d){
	if(r-l<=1){
		if(F(r, d)<=n || F(l, d)<=n) return true;
		return false;
	}
	long long m=(l+r/2);
	if(F(m, d)>n){
		if(F(m+1, d)>F(m, d)) return Binary_search(l, m, n, d);
	 	return Binary_search(m, r, n, d);
	}
	return true;
}
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		long long n, d;
		cin >> n >> d;
		cout << (Binary_search(0, n, n, d)==true? "YES\n": "NO\n");
	}
}


#include <bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		long long n, d;
		cin >> n >> d;
		if(-(n-2)*(n-2)/4+d-n<=0) cout << "YES\n";
		else cout << "NO\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		long long n, d;
		cin >> n >> d;
		if(-((n-2)*(n-2)+3)/4+d-n-1<=0) cout << "YES\n";
		else cout << "NO\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
long long F(long long x, long long d){
	return x+(d+x)/(x+1);
}
bool Binary_search(long long l, long long r, long long n, long long d){
	if(r-l<=1){
		if(F(r, d)<=n || F(l, d)<=n) return true;
		return false;
	}
	long long m=(l+r)/2;
	if(F(m, d)>n) return Binary_search(l, m, n, d);
	return true;
}
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		long long n, d;
		cin >> n >> d;
		cout << (Binary_search(0, n, n, d)==true? "YES\n": "NO\n");
	}
}


#include <bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		long long n, d;
		cin >> n >> d;
		if(-(n-2)*(n-2)/4.0+d-n<=0) cout << "YES\n";
		else cout << "NO\n";
	}
}


//tim test hack code
#include <bits/stdc++.h>
using namespace std;
long long F(long long x, long long d){
	return x+(d+x)/(x+1);
}
bool Binary_search(long long l, long long r, long long n, long long d){
	if(r-l<=1){
		if(F(r, d)<=n || F(l, d)<=n) return true;
		return false;
	}
	long long m=(l+r/2);
	if(F(m, d)>n) return Binary_search(l, m, n, d);
	return true;
}
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t;
	cin >> t;
	while(t--){
		long long n, d;
		cin >> n >> d;
		cout << (Binary_search(0, n, n, d)==true? "YES\n": "NO\n");
	}
}


#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	int T;
	scanf("%d", &T);

	int n, d, x, t;
	while(T--)
	{
		scanf("%d%d", &n, &d);
		if(n >= d)
		{
			puts("YES");
			continue;
		}
		x = (int)sqrt(d);
		t = d/(x+1);
		if( d/(x+1) != (int)(d/(x+1)) )	t++;

		if(x+t < n)	puts("YES");
		else	puts("NO");
	}

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int T;
	scanf("%d", &T);

	bool is = 0;
	int n, d, x, t;
	while(T--)
	{
		is = 0;
		scanf("%d%d", &n, &d);
		if(n >= d)
		{
			puts("YES");
			continue;
		}

		for(int i=1; i<=d; i++)
		{
			x = i;
			t = d/(x+1);
			if( d/(x+1) != (int)(d/(x+1)) )	t++;
			if(x+t < n)
			{
				puts("YES");
				is = 1;
				break;
			}
		}
		if(is == 0)	puts("NO");

	}

	return 0;
}


#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	int T;
	scanf("%d", &T);

	int n, d, x, t;
	while(T--)
	{
		scanf("%d%d", &n, &d);
		if(n >= d)
		{
			puts("YES");
			continue;
		}
		x = (int)sqrt(d);
		t = d/(x+1);
		if( d/(x+1) != (int)(d/(x+1)) )	t++;

		if(x+t < n)
		{
			puts("YES");
			continue;
		}
		else
		{
			x++;
			t = d/(x+1);
			if( d/(x+1) != (int)(d/(x+1)) )	t++;
			if(x+t < n)
			{
				puts("YES");
			}
			else	puts("NO");
		}

	}

	return 0;
}


#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	int T;
	scanf("%d", &T);

	bool is = 0;
	int n, d, x, t;
	while(T--)
	{
		is = 0;
		scanf("%d%d", &n, &d);
		if(n >= d)
		{
			puts("YES");
			continue;
		}

		for(int i=(int)sqrt(d)-1; i<=(int)sqrt(d)+1; i++)
		{
			x = i;
			t = d/(x+1);
		//	cout<<t<<" ";
			if( d/(x+1.0) != (int)(d/(x+1)) )	t++;
		//	cout<<t<<"_";
			if(x+t <= n)
			{
				puts("YES");
				is = 1;
				break;
			}
		}
		if(is == 0)	puts("NO");

	}

	return 0;
}


#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	int T;
	scanf("%d", &T);

	bool is = 0;
	int n, d, x, t;
	while(T--)
	{
		is = 0;
		scanf("%d%d", &n, &d);
		if(n >= d)
		{
			puts("YES");
			continue;
		}

		for(int i=(int)sqrt(d); i<=(int)sqrt(d)+1; i++)
		{
			x = i;
			t = d/(x+1);
			if( d/(x+1.0) != (int)(d/(x+1)) )	t++;
			if(x+t <= n)
			{
				puts("YES");
				is = 1;
				break;
			}
		}
		if(is == 0)	puts("NO");

	}

	return 0;
}


// #492 Div. 2
// A

#include <iostream>
#include <vector>

int main() {
	int n, d;
	std::cin >> n >> d;
    std::vector<int> V(n);

    int res = 1;
    int lastPos = 0;
    for(int ii = 0; ii < n; ii++) {
        std::cin >> V[ii];
    }

    for(int ii = 1; ii < n-1; ii++) {
        if((V[ii] - d) >= lastPos) {
            ++res;
        }

        if((V[ii] + d) < (V[ii+1] - d)) {
            ++res;
        }
        lastPos = V[ii] + d;
    }

    if((V[n-1] - d) >= lastPos) {
        ++res;
    }

    std::cout << ++res << std::endl;
}


// Send
// #492 Div. 2
// A

#include <iostream>
#include <vector>

int main() {
	int n, d;
	std::cin >> n >> d;
    std::vector<int> V(n);

    int res = 1;
    for(int ii = 0; ii < n; ii++) {
        std::cin >> V[ii];
    }
    int lastPos = V[0] + d + 1;
    if((n > 1) && ((V[0] + d) <= (V[1] - d))) {
        //std::cout << "Pos: " << (V[0] + d) << std::endl;
        ++res;
    }

    for(int ii = 1; ii < n-1; ii++) {
        if((V[ii] - d) >= lastPos) {
            //std::cout << "Pos: " << (V[ii] - d) << std::endl;
            ++res;
        }

        if((V[ii] + d) < (V[ii+1] - d)) {
            //std::cout << "Pos: " << (V[ii] + d) << std::endl;
            ++res;
        }
        lastPos = V[ii] + d;
    }

    if((V[n-1] - d) >= lastPos) {
        //std::cout << "Pos: " << (V[n-1] - d) << std::endl;
        ++res;
    }

    std::cout << ++res << std::endl;
}


// Send
// #492 Div. 2
// A

#include <iostream>
#include <vector>

int main() {
	int n, d;
	std::cin >> n >> d;
    std::vector<int> V(n);

    int res = 1;
    for(int ii = 0; ii < n; ii++) {
        std::cin >> V[ii];
    }
    int lastPos = V[0] + d;

    for(int ii = 1; ii < n-1; ii++) {
        if((V[ii] - d) >= lastPos) {
            std::cout << "Pos: " << (V[ii] - d) << std::endl;
            ++res;
        }

        if((V[ii] + d) < (V[ii+1] - d)) {
            std::cout << "Pos: " << (V[ii] + d) << std::endl;
            ++res;
        }
        lastPos = V[ii] + d;
    }
    //std::cout << "lastPos: " << lastPos << std::endl;

    if((V[n-1] - d) >= lastPos) {
        std::cout << "Pos: " << (V[n-1] - d) << std::endl;
        ++res;
    }

    std::cout << ++res << std::endl;
}


// Send
// #492 Div. 2
// A

#include <iostream>
#include <vector>

int main() {
	int n, d;
	std::cin >> n >> d;
    std::vector<int> V(n);

    int res = 1;
    for(int ii = 0; ii < n; ii++) {
        std::cin >> V[ii];
    }
    int lastPos = V[0] + d;
    if((n > 1) && ((V[0] + d) <= (V[1] - d))) {
        //std::cout << "Pos: " << (V[0] + d) << std::endl;
        ++res;
    }

    for(int ii = 1; ii < n-1; ii++) {
        if((V[ii] - d) > lastPos) {
            //std::cout << "Pos: " << (V[ii] - d) << std::endl;
            ++res;
        }

        if((V[ii] + d) < (V[ii+1] - d)) {
            //std::cout << "Pos: " << (V[ii] + d) << std::endl;
            ++res;
        }
        lastPos = V[ii] + d;
    }

    if((V[n-1] - d) >= lastPos) {
        //std::cout << "Pos: " << (V[n-1] - d) << std::endl;
        ++res;
    }

    std::cout << ++res << std::endl;
}


// Send
// #492 Div. 2
// A

#include <iostream>
#include <vector>

int main() {
	int n, d;
	std::cin >> n >> d;
    std::vector<int> V(n);

    int res = 1;
    for(int ii = 0; ii < n; ii++) {
        std::cin >> V[ii];
    }
    int lastPos = V[0] + d;
    if((n > 1) && ((V[0] + d) <= (V[1] - d))) {
        //std::cout << "Pos: " << (V[0] + d) << std::endl;
        ++res;
    }

    for(int ii = 1; ii < n-1; ii++) {
        if((V[ii] - d) >= lastPos) {
            //std::cout << "Pos: " << (V[ii] - d) << std::endl;
            ++res;
        }

        if((V[ii] + d) < (V[ii+1] - d)) {
            //std::cout << "Pos: " << (V[ii] + d) << std::endl;
            ++res;
        }
        lastPos = V[ii] + d;
    }

    if((V[n-1] - d) >= lastPos) {
        //std::cout << "Pos: " << (V[n-1] - d) << std::endl;
        ++res;
    }

    std::cout << ++res << std::endl;
}


// Send
// #492 Div. 2
// A

#include <iostream>
#include <vector>

int main() {
	int n, d;
	std::cin >> n >> d;
    std::vector<int> V(n);

    int res = 1;
    for(int ii = 0; ii < n; ii++) {
        std::cin >> V[ii];
    }
    int lastPos = V[0] + d;

    for(int ii = 1; ii < n-1; ii++) {
        if((V[ii] - d) >= lastPos) {
            //std::cout << "Pos: " << (V[ii] - d) << std::endl;
            ++res;
        }

        if((V[ii] + d) < (V[ii+1] - d)) {
            //std::cout << "Pos: " << (V[ii] + d) << std::endl;
            ++res;
        }
        lastPos = V[ii] + d;
    }
    //std::cout << "lastPos: " << lastPos << std::endl;

    if((V[n-1] - d) >= lastPos) {
        //std::cout << "Pos: " << (V[n-1] - d) << std::endl;
        ++res;
    }

    std::cout << ++res << std::endl;
}


#include <cstdio>
#include <vector>

int main(){

    long n, d; scanf("%ld %ld", &n, &d);
    std::vector<long> x(n); for(long p = 0; p < n; p++){scanf("%ld", &x[p]);}
    long cnt(2);
    for(long p = 1; p < n; p++){cnt += (x[p] - x[p - 1] == 2 * d) + 2 * (x[p] - x[p - 1] > 2 * d);}
    printf("%ld\n", cnt);

    return 0;
}


#include<cstdio>
#include<vector>
#include<cmath>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	int i;
	long long d;
	long long input, prev;
	int cnt = 2;

	scanf("%d %lld", &n, &d);

	scanf("%lld", &input);

	prev = input;

	for (i = 1; i < n; i++)
	{
		scanf("%lld", &input);

		if (input - prev > 2 * d)
		{
			cnt += 2;
		}

		else if (input - prev == 2 * d)
		{
			cnt++;
		}

		prev = input;
	}

	printf("%d\n", cnt);

	return 0;
}


#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <Windows.h>
#include <string>
#include <set>
#include <bitset>
#include <vector>
#include <stack>
#include <map>
#include <queue>
#include <ctime>
#include <cassert>
using namespace std;

#define ll int long long
const int mod = 1000000000 + 7;

long long numb(int a) {
	long long m = 1;
	while (a--) {
		m *= 2;
	}
	return m;
}
vector<int> del(int n) {
	vector<int>pr(n + 1);
	for (int i = 0; i <= n; i++) {
		pr[i] = i;
	}
	for (int p = 2; p <= n; p++) {
		if (pr[p] != 0) {
			for (int j = p * p; j <= n; j += p) {
				pr[j] = 0;
			}
		}
	}
	return pr;
}
long long dv(int x) {
	int i;
	int mod;
	long d = 0;
	for (i = 0; x > 0; i++) {
		mod = x % 2;
		x = (x - mod) / 2;
		d += mod * pow((double)10, i);
	}
	return d;
}
int dv_to_des(int x) {
	int res = 0;
	int q = 0;
	while (x > 0) {
		int tmp = x % 10; //выделяем последнюю цифру
		if (tmp == 1) res += pow(2, q);
		x = x / 10;
		q++;
	}
	return res;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int n,d;
	cin >> n>>d;
	vector<int>a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	int k = 2;
	for (int i = 0; i < (n - 1); i++) {
		if (abs(a[i] - a[i + 1]) >= 2 * d) {
			int t = (a[i + 1] - d) - (a[i] + d);
			if (t == 0) k += 1;
			else k += 2;
		}
	}
	cout << k;
	return 0;
}


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

int main() {
	int n, d, count = 2;
	cin >> n >> d;
	int* arr = new int [n];
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = 0; i < n; i++) {
		if ((arr[i + 1] - arr[i]) >= d && i < n - 2) {
			count++;
		}
		else if ((arr[i + 1] - arr[i]) >= d * 2 && i < n - 1) {
			count += 2;
		}
	}
	cout << count;
	return 0;
}


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

int main() {
	int n, d, count = 2;
	cin >> n >> d;
	int* arr = new int [n];
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = 0; i < n; i++) {
		if ((arr[i + 1] - arr[i]) >= d && i < n - 2) {
			count++;
		}
		else if ((arr[i + 1] - arr[i]) >= d * 2 && i < n - 2) {
			count += 2;
		}
	}
	cout << count;
	return 0;
}


#include <iostream>
using namespace std;
int main() {
	int n, d;
	cin >> n >> d;
	int *a = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	int count = 2;
	for (int i = 0; i < n - 1; ++i) {
		int newCities = a[i + 1] - a[i] - 2 * d + 1;
		if (newCities <= 0)
			newCities = 0;
		else if (newCities >= 2)
			newCities = 2;

		count += newCities;
	}
	cout << count << endl;
	return 0;
}


#include <iostream>
using namespace std;
int main() {
	int n, d, o[100], ans = 2;
	cin >> n >> d;
	for (int i = 0; i < n; i++) {
		cin >> o[i];
	}
	for (int i = 0; i < n-1; i++) {
		if (abs(o[i] - o[i + 1]) >= 2 * d) {
			ans += 2;
			continue;
		}
		if (abs(o[i] - o[i + 1]) == 2 * d) {
			ans++;
			continue;
		}
	}
	cout << ans;
	return 0;
}


#include <iostream>
using namespace std;
int main(){
	int n,d,*a,count=2;
	cin>>n>>d;
	a=new int [n];
	for(int i=0; i<n; i++) cin>>a[i];
	for(int i=1; i<n; i++){
		if(a[i]-a[i-1]==2*d) count++;
		else if(a[i]-a[i-1]>2*d) count+=2;
	}
	cout<<count;
}


#include <iomanip>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <ctime>
#include <cstdio>
#include <cmath>
#include <queue>
#include <bitset>
#include <string>

#define ll long long
#define mp make_pair
#define pb push_back

using namespace std;

const int N = 110;
const ll INF = 1e18+1;

int n, d, a[N];

int main() {
    cin >> n >> d;
    for (int i = 1; i <= n; i++) cin >> a[i];
    int ans = 2;
    for (int i = 1; i < n; i++) {
        if (a[i + 1] - a[i] > 2 * d) ans += 2;
        else if (a[i + 1] - a[i] == 2 * d) ans++;
    }
    cout << ans;
    return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
#include<numeric>
#include<list>
#define PI acos(-1.0)
using namespace std;
int main()
{
	int n, d, flag = 0;
	int a[105];
	cin >> n >> d;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n - 1; i++)
	{
		if (a[i] + d < a[i + 1] - d)
			flag += 2;
		else if (a[i] + d == a[i + 1] - d)
			flag++;
		else
			continue;
	}
	cout << flag + 2;
	return 0;
}


#include<iostream>

using namespace std;

int main() {
	int n, a[100];
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	int count = 0;
	for (int i = 1; i < n - 1; i++)
		if (a[i] == 0 && a[i - 1] == 1 && a[i + 1] == 1)count++;
	if (count == 0) {
		cout << 0;
		return 0;
	}

	return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;

int main() {
	int n, d, a[100], sum = 2;
	cin >> n >> d;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n - 1; i++) {
		long long s = abs(a[i] - a[i + 1]);
		if (s == 2 * d)sum++;
		if (s > 2 * d)sum += 2;
	}
	cout << sum;
	return 0;
}


#include<iostream>
#include<string>
#include<set>
#include<vector>
#include<math.h>

using namespace std;
int main()
{
	int n, d, i,s=2;
	cin >> n >> d;
	vector<int> m(n);
	for (i = 0;i < n;i++)
		cin >> m[i];
	for (i = 0;i < n - 1;i++)
	{
		if (m[i + 1] - m[i] == d * 2)
			s++;
		if (m[i + 1] - m[i] > d * 2)
			s += 2;
	}
	cout << s;
	getchar();
	getchar();
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	setlocale(LC_ALL, "RUS");
	int n, d, x, x2, j = 0;
	cin >> n >> d >> x;
	for (int i = 1; i < n; i++)
	{
		cin >> x2;
		if (abs(x - x2) - 2 * d == 0)
			j++;
		else if (abs(x - x2) - 2 * d > 0)
			j += 2;
		x = x2;
	}
	cout << j + 2;
	return 0;
}


#include<iostream>
#include<math.h>
using namespace std;
int main(){
	int n,k,*a,x=2;
	cin>>n>>k;
	a=new int[n];
	for(int i=0;i<n;i++)
		cin>>a[i];

	for(int i=0;i<n-1;i++)
			x+=(a[i]+k==a[i+1]-k ? 1 : (a[i+1]-a[i]>2*k) ? 2 : 0);
	cout<<x;
}


// 1004A.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
using namespace std;
int main()
{
	int n, * a, d,counter=2,t;
	cin >> n >> d;
	a = new int[n];
	cin >> a[0];
	t = a[0];
	for (int i = 1; i < n; i++)
	{
		cin >> a[i];
		if ((a[i] - t - 1) == (2 * d - 1))
			counter++;
		else if ((a[i] - t - 1) > (2 * d - 1))
			counter += 2;

		t = a[i];
	}
	cout << counter;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
using namespace std;

int main() {
	int n, d;
	scanf("%d%d", &n, &d);
	int arr[100];
	for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
	int count = 0;
	for (int i = 0; i < n - 1; i++) {
			if(abs(arr[i] - arr[i + 1]) < d * 2) count += 2;
			else if (abs(arr[i] - arr[i + 1]) == d * 2) count += 1;
	}
	printf("%d", n * 2 - count);
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
using namespace std;

int main() {
	int n, d;
	scanf("%d%d", &n, &d);
	int arr[100];
	for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
	int count = 0;
	for (int i = 0; i < n - 1; i++) {
		for (int j = i + 1; j < n; j++) {
			if(abs(arr[j] - arr[i]) < d * 2) count += 2;
			else if (abs(arr[j] - arr[i]) == d * 2) count += 1;
		}
	}
	printf("%d", n * 2 - count);
}


#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int n,d,*x,number=2;

int main()
{

	cin>>n>>d;
	x = new int [n];
	for(int i=0;i<n;i++)cin>>x[i];

	for(int i=1;i<n-1;i++){
		if(x[i+1] - x[i]+d >=d && x[i]+d - x[i-1] >=d )number++;
		if(x[i+1] - x[i]-d >=d && x[i]-d - x[i-1] >=d )number++;
	}
	//if(x[1]-x[0]+d>=d)number++;
	if(x[n-1]-d-x[n-2]>=d)number++;
	cout<<number;

}

// Code Number : 237


#include<iostream>
using namespace std;
int n,d,number=2,a,b;

int main()
{

	cin>>n>>d>>a;
	d+=d;

	for(int i=1;i<n;i++)
	{

		cin>>b;
		if(b-a==d)number++;
		else if(b-a>d)number+=2;
		a=b;

	}

	cout<<number;

}

// Code Number : 237


#include <iostream>
using namespace std;
int main(){
	int n, d, *a, count=0;
	cin >> n >> d;
	a = new int[n];
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	for (int i = 0; i < n-1; i++){
		if (abs(a[i + 1] - a[i]) >= 2 * d) {
			if (abs(a[i + 1] - a[i]) == 2 * d) count++;
			else count += 2;
		}
	}
	cout << count+2;
	return 0;
}


#include <iostream>
using namespace std;
int main(){
	int n, d, *a, count=0;
	cin >> n >> d;
	a = new int[n];
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	for (int i = 0; i < n; i++){
		count += (abs(a[i + 1] - a[i])>=2 * d ? 2 : abs(a[i + 1] - a[i]) == 2 * d ? 1 : 0);
	}
	cout << count;
	return 0;
}


#include <iostream>
using namespace std;
int main(){
	int n, d, *a, count=0;
	cin >> n >> d;
	a = new int[n];
	for (int i = 0; i < n-1; i++){
		cin >> a[i];
	}
	for (int i = 0; i < n; i++){
		if (abs(a[i + 1] - a[i]) >= 2 * d) {
			if (abs(a[i + 1] - a[i]) == 2 * d) count++;
			else count += 2;
		}
	}
	cout << count+2;
	return 0;
}


#include <iostream>
using namespace std;
int main(){
	int n, d, *a, count=0;
	cin >> n >> d;
	a = new int[n];
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	for (int i = 0; i < n; i++){
		if (abs(a[i + 1] - a[i]) >= 2 * d) {
			if (abs(a[i + 1] - a[i]) == 2 * d) count++;
			else count += 2;
		}
	}
	cout << count;
	return 0;
}


#include <iostream>
using namespace std;
int main(){
	int n, d, *a, count=0;
	cin >> n >> d;
	a = new int[n];
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	for (int i = 0; i < n; i++){
		count += (abs(a[i + 1] - a[i])>2 * d ? 2 : abs(a[i + 1] - a[i]) == 2 * d ? 1 : 0);
	}
	cout << count;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int a, b,*c,d=4;
	cin >> a >> b;
	c = new int[a];
	for (int i = 0; i < a; i++)
		cin >> c[i];
	for (int i = 0; i < a-1; i++)
	{
		if (c[i] + b < c[i + 1] - b)
			d += 2;
		else if (c[i] + b == c[i + 1] - b)
			d++;
	}
	cout << d;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int a, b,*c,d=4;
	cin >> a >> b;
	c = new int[a];
	for (int i = 0; i < a; i++)
		cin >> c[i];
	for (int i = 0; i < a-1; i++)
	{
		cout << c[i] << " " << c[i + 1] << endl;
		if (c[i] + b < c[i + 1] - b)
			d += 2;
		else if (c[i] + b == c[i + 1] - b)
			d++;
	}
	cout << d;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int a, b,*c,d=4;
	cin >> a >> b;
	c = new int[a];
	for (int i = 0; i < a; i++)
		cin >> c[i];
	for (int i = 1; i < a - 1; i++)
	{
		if (c[i] + b <= c[i+1] - b)
			d++;
	}
	cout << d;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int a, b,*c,d=2;
	cin >> a >> b;
	c = new int[a];
	for (int i = 0; i < a-1; i++)
		cin >> c[i];
	for (int i = 0; i < a; i++)
	{
		if (c[i] + b < c[i + 1] - b)
			d += 2;
		else if (c[i] + b == c[i + 1] - b)
			d++;
	}
	cout << d;
	return 0;

}


#include <iostream>
using namespace std;
int main()
{
	int a, b,*c,d=0;
	cin >> a >> b;
	c = new int[a];
	for (int i = 0; i < a; i++)
		cin >> c[i];
	for (int i = 0; i < a; i++)
	{
		if (c[i] + b < c[i + 1] - b)
			d += 2;
		else if (c[i] + b == c[i + 1] - b)
			d++;
	}
	cout << d+2;
	return 0;

}


#include <iostream>
using namespace std;
int main()
{
	int a, b,*c,d=2;
	cin >> a >> b;
	c = new int[a];
	for (int i = 0; i < a; i++)
		cin >> c[i];
	for (int i = 0; i < a-1; i++)
	{
		if (c[i] + b < c[i + 1] - b)
			d += 2;
		else if (c[i] + b == c[i + 1] - b)
			d++;
	}
	cout << d;
	return 0;
}


#include<iostream>
#include<string>
#include<fstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<cstdlib>
#include<vector>
#include<set>
using namespace std;
ofstream fo("test.out");
ifstream fi("test.inp");
#define N 100005
//#define mod 1000000007
#define For for(long long i=1;i<=n;i++)
#define For2 for(long long j=0;j<m;j++)
#define maxx 200005
#define ll long long
const ll MOD = 1e9 + 7;
const ll base = 269;
// for(long long i=1;i<=n;i++)
/*
MIKUNO - 15/02/1999
*/
//const int nmax = 2e5 + 5;
const int nmax = 25;
int n, d, a[105], rs;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin >> n >> d;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n - 1; i++)
	{
		int t1 = a[i] + d;
		int t2 = a[i + 1] - d;
		if (a[i + 1] - t1 >= d) rs++;
		if (t2 - a[i] >= d&&t1!=t2) rs++;

	}
	rs += 2;
	cout << rs;
	//system("pause");
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;/*
					int a[101];
					int main()
					{
					int n,k;
					cin>>n>>k;
					for(int i=0;i<n;++i)
					cin>>a[i];
					int ans=0;
					for(int i=0;i<n;++i){
					int x=a[i]-k;
					int y=a[i]+k;
					int flag=0;
					for(int j=0;j<n;++j){
					if((a[i]-x))*/
long long t[1005];

int main()
{
	long long a, d;
	a = 0;
	int n, b;
	scanf("%d %I64d", &n, &d);
	for (int i = 0; i < n; i++)
	{
		scanf("%I64d", &t[i]);
	}
	sort(t, t + n);
	d *= 2;
	for (int i = 1; i < n; i++)
	{
		b = (t[i] - t[i - 1]);
		if (b > d)
			a += 2;
		else
			if (b == d)
				a += 1;
	}
	a += 2;
	printf("%I64d\n", a);
	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n, d, x[110], hotel = 0;
	cin >> n >> d;
	cin >> x[1];
	hotel++;
	for (int i = 2; i <= n; i++) {
	    cin >> x[i];
	    if (x[i] - x[i - 1] > 2 * d) hotel += 2;
	    else if (x[i] - x[i - 1] == 2 * d) hotel++;
	}
	hotel++;
	cout << hotel;
	return 0;
}


#include<cstdio>
#include<memory.h>
#include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<string.h>
#include<queue>
#define num 1000000000
using namespace std;
int main()
{
	int arr[200],n,d,ans=0;
	scanf("%d %d", &n,&d);
	for (int i = 0; i < n; i++)scanf("%d", &arr[i]);
	if (n == 1) {
		printf("%d", 2);
		return 0;
	}
	for (int i = 0; i < n; i++) {
		if (i == 0) {
			ans++;
			if ((arr[i] + d <= arr[i + 1]-d))ans++;
			continue;
		}
		if (i == n - 1) {
			ans++;
			if (arr[i] - d > arr[i - 1]+d)ans++;
			continue;
		}
		if (arr[i] + d <= arr[i + 1]-d)ans++;
		if (arr[i] - d > arr[i - 1] + d)ans++;
	}
	printf("%d", ans);
	return 0;
}


#include<cstdio>
#include<memory.h>
#include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<string.h>
#include<queue>
#define num 1000000000
using namespace std;
int main()
{
	int arr[200],n,d,ans=0;
	scanf("%d %d", &n,&d);
	for (int i = 0; i < n; i++)scanf("%d", &arr[i]);
	for (int i = 0; i < n; i++) {
		if (i == 0) {
			if(arr[i]-d >= -num) ans++;
			if (arr[i] + d <= arr[i + 1]-d)ans++;
			continue;
		}
		if (i == n - 1) {
			if(arr[i]+d <= num) ans++;
			if ((arr[i] - d >= arr[i - 1]+d)&&(arr[i] - d != arr[i - 1] + d))ans++;
			continue;
		}
		if (arr[i] + d <= arr[i + 1]-d)ans++;
		if ((arr[i] - d >= arr[i - 1]+d)&&(arr[i]-d != arr[i-1]+d))ans++;
	}
	printf("%d", ans);
	return 0;
}


#include<cstdio>
#include<memory.h>
#include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<string.h>
#include<queue>
#define num 1000000000
using namespace std;
int main()
{
	int arr[200],n,d,ans=0;
	scanf("%d %d", &n,&d);
	for (int i = 0; i < n; i++)scanf("%d", &arr[i]);
	for (int i = 0; i < n; i++) {
		if (i == 0) {
			if(arr[i]-d >= -num) ans++;
			if ((arr[i] + d <= arr[i + 1]-d)&&(arr[i]+d <= num))ans++;
			continue;
		}
		if (i == n - 1) {
			if(arr[i]+d <= num) ans++;
			if ((arr[i] - d >= arr[i - 1]+d)&&(arr[i] - d != arr[i - 1] + d)&&(arr[i]-d>=-num))ans++;
			continue;
		}
		if ((arr[i] + d <= arr[i + 1]-d)&&(arr[i]+d <= num))ans++;
		if ((arr[i] - d >= arr[i - 1]+d)&&(arr[i]-d != arr[i-1]+d)&&(arr[i]-d>=-num))ans++;
	}
	printf("%d", ans);
	return 0;
}


#include<cstdio>
#include<memory.h>
#include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<string.h>
#include<queue>
using namespace std;
int main()
{
	int arr[200],n,d,ans=0;
	scanf("%d %d", &n,&d);
	for (int i = 0; i < n; i++)scanf("%d", &arr[i]);
	for (int i = 0; i < n; i++) {
		if (i == 0) {
			ans++;
			if (arr[i] + d <= arr[i + 1]-d)ans++;
			continue;
		}
		if (i == n - 1) {
			ans++;
			if ((arr[i] - d >= arr[i - 1]+d)&&(arr[i] - d != arr[i - 1] + d))ans++;
			continue;
		}
		if (arr[i] + d <= arr[i + 1]-d)ans++;
		if ((arr[i] - d >= arr[i - 1]+d)&&(arr[i]-d != arr[i-1]+d))ans++;
	}
	printf("%d", ans);
	return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stdio.h>
using namespace std;

int main()
{
	long long n,d;
	cin>>n>>d;
	long long prev;
	long long ans=2;
	cin>>prev;
	long long test;
	for(int i=1;i<n;i++)
	{
		cin>>test;
		if(test-prev>2*d)
		{
			ans+=2;
		}
		else if(test-prev==2*d)
		{
			ans++;
		}
		prev=test;
	}
	cout<<ans<<endl;
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
#include <stack>

using namespace std;

int main()
{
	long long n, d;
	cin >> n >> d;
	int c = 2;
	long long p;
	cin >> p;

	for (int i = 1;i < n;i++)
	{
		long long a;
		cin >> a;
		long long r = a - d - (p + d) + 1;
		if (r == 1)
			c++;
		if (r > 1)
			c += 2;
		p = a;
	}

	cout << c << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
#include <stack>

using namespace std;

int main()
{
	long long n, d;
	cin >> n >> d;
	int c = 2;
	long long p;
	cin >> p;

	for (int i = 1;i < n;i++)
	{
		long long a;
		cin >> a;
		if (p + d <= a - d)
			c += (a - d - (p + d) + 1);
		p = a;
	}

	cout << c << endl;
	//system("pause");
	return 0;
}


#include<iostream>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <vector>
#include <cstring>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
ll n, d,la;
int main() {
	cin >> n >> d;
	ll wa = 2,t;
	cin >> la;
	for (int i = 1; i < n; i++) {
		cin >> t;
		if (t - la == 2 * d)wa++;
		else if (t - la > 2 * d)wa += 2;
		la = t;
	}
	cout << wa << endl;
}


#include<iostream>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <vector>
#include <cstring>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
ll n, d,la;
int main() {
	cin >> n >> d;
	ll wa = 2,t;
	cin >> la;
	for (int i = 1; i < n; i++) {
		cin >> t;
		if (t - la >= 2 * d)wa++;
		la = t;
	}
	cout << wa << endl;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <queue>
#include <cstring>
#include <fstream>
#define ll long long int
using namespace std;
const double _pi = acos(-1.0);
int main()
{
    //freopen("in.txt", "r", stdin);
	int n, d;
	set<int> s;
	scanf("%d %d", &n, &d);
	vector<int> v(n);
	for(int i = 0; i < n; i++) scanf("%d", &v[i]);
	sort(v.begin(), v.end());
	s.insert(v[0] - d);
	s.insert(v[n-1] + d);
	for(int i = 0; i < n; i++)
	{
		if(i > 0 && (v[i-1] + d) <= (v[i] - d)) s.insert(v[i] - d);
		if(i < n - 1 && (v[i+1] - d) >= (v[i] + d)) s.insert(v[i] + d);
	}
	printf("%d\n", s.size());
    return 0;
}


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

int main()
{
	int n,d,i,count=2;
	long long x[100];
	cin>>n>>d;
	 for (i=0;i<n;i++)
		 cin>>x[i];

	 for (i=1;i<n;i++){
	  if (x[i]-x[i-1] >2*d)
		  count+=2;
	  else if (x[i]-x[i-1] == 2*d)
		  count++;
	 }

	 cout<<count;

    return 0;
}


#include<iostream>
using namespace std;
int main(){
	int i,n,d;
	cin>>n>>d;
	int a[101];
	int ans=2*n;
	for(i=0;i<n;i++)
	 cin>>a[i];
	for(i=0;i<n-1;i++)
	{   if(a[i]+d==a[i+1]-d) ans=ans-1;
		if(a[i]+d>a[i+1]-d) ans=ans-2;
	}
	cout<<ans;
}


#include<iostream>
using namespace std;
int n;
long c,dem=0,d, a[100]={0};

int main()
{
    cin>>n>>d;
    for (int i=1; i<=n; i++)
        cin>>a[i];

    for (int i=2; i<=n; i++)
        if (abs(a[i]-a[i-1])==d*2) dem++;
        else if (abs(a[i]-a[i-1])>d*2) dem+=2;

    dem+=2;
    cout<<dem;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int o[100000];
vector<int>vis;
int n,d;
int main() {
    while(cin>>n>>d)
    {
        vis.clear();
        for(int i=0;i<n;i++)
        {
            cin>>o[i];
            vis.push_back(o[i]);
        }
        int num=0;
        for(int i=0;i<n;i++)
        {
            int deal1=o[i]+d;
            int deal2=o[i]-d;
           // cout<<deal1<<' '<<deal2<<endl;
            bool flag=true;
            vector<int>::iterator re=find(vis.begin(),vis.end(),deal1);
            if(re==vis.end()){
                for (int j = 0; j < n; j++) {

                    if (abs(o[j] - deal1) < d) {
                        flag = false;
                        break;
                    }

                }
                if (flag) {
                    //cout<<deal1<<endl;
                    vis.push_back(deal1);
                    num++;
                }
            }
            vector<int>::iterator result = find( vis.begin( ), vis.end( ), deal2 );
            if(result==vis.end()){
                flag = true;
                for (int j = 0; j < n; j++) {
                    //cout<<abs(o[j] - deal2)<<endl;
                    if (abs(o[j] - deal2) < d) {
                        flag = false;
                        break;
                    }

                }
                if (flag) {
                    //cout<<deal2<<endl;
                    vis.push_back(deal2);
                    num++;
                }
            }
        }
        cout<<num<<endl;
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int o[100000];
int n,d;
int main() {
    while(cin>>n>>d)
    {
        for(int i=0;i<n;i++)
        {
            cin>>o[i];
        }
        int num=0;
        for(int i=0;i<n-1;i++)
        {
            if(o[i+1]-o[i]>=2*d)
            {
                if((o[i+1]-d)==(o[i]+d))
                {
                    num+=1;
                } else{
                    num+=2;
                }
                //cout<<o[i]<<' '<<o[i+1]<<' '<<((o[i+1]-d)-(d+o[i]))+1<<endl;
            }
        }
        cout<<num+2<<endl;
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
using namespace std;
int n,d,x[111];
map<int,int>hs;
int main()
{
	scanf("%d%d",&n,&d);
	int i,j,s,p,q,y;
	for(i=0;i<n;i++)
	   scanf("%d",&x[i]);
	hs.clear();
	for(i=0;i<n;i++)
	{
		for(s=0;s<2;s++)
		{
    		y=x[i]+(2*s-1)*d;
    		for(j=0;j<n;j++)
    		{
    			if(abs(x[j]-y)<d)
    			   break;
    		}
    		if(j>=n)
    			hs[y];
    	}
	}
	printf("%d\n",hs.size());
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()
{
	int n,d,cnt=0;

	cin>>n>>d;

	vector<int>a(n);

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

	for(int i=1;i<n;i++)
	{
		if(abs(a[i]-a[i-1])==2*d)
		{
			cnt++;
		}
		if(abs(a[i]-a[i-1])>2*d)
		{
			cnt+=2;
		}
	}
	cout<<cnt+2<<endl;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int main()
{
	int n, i, k = 0, a[10000], x = 0, y = 0;
	cin >> n >> k;
	for (i = 0;i < n;i++)
		cin >> a[i];

	sort(a, a + n);
	if (n == 1)
	{
		cout << 2 << endl;
		return 0;
	}
	if (n > 1)
		x = 2;
	else
		x = 1;

	for (i = 0;i < n;i++)
	{
		if (a[i] + 2 * k < a[i + 1] && i!=n-1)
			x++;
		if (a[i] - 2 * k > a[i - 1] && i != 0)
			x++;
		if (a[i] + 2 * k == a[i + 1] && i != n - 1)
			y++;
		if (a[i] - 2 * k == a[i - 1] && i != 0)
			y++;
	}
	//cout << x << " " << y << endl;
	cout << x+y/2 << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
	int n, i, k = 0, a[10000], x = 0, y = 0;
	cin >> n >> k;
	for (i = 0;i < n;i++)
		cin >> a[i];

	sort(a, a + n);
	if (n == 1)
	{
		cout << 2 << endl;
		return 0;
	}
	x = 2;
	for (i = 0;i < n - 1;i++)
	{
		if (a[i + 1] - a[i] > 2 * k)
			x += 2;
		if (a[i + 1] - a[i] == 2 * k)
			x++;
	}
	cout << x  << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int main()
{
	int n, i, j, k = 0, m = 0, a[10000], x = 0, y = 0;
	char s[10000];
	cin >> n >> k;
	for (i = 0;i < n;i++)
		cin >> a[i];

	sort(a, a + n);
	if (n > 1)
		x = 2;
	else
		x = 1;

	for (i = 0;i < n;i++)
	{
		if (a[i] + 2 * k < a[i + 1] && i!=n-1)
			x++;
		if (a[i] - 2 * k > a[i - 1] && i != 0)
			x++;
		if (a[i] + 2 * k == a[i + 1] && i != n - 1)
			y++;
		if (a[i] - 2 * k == a[i - 1] && i != 0)
			y++;
	}
	//cout << x << " " << y << endl;
	cout << x+y/2+m << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
	int n, i, k = 0, a[10000], x = 0, y = 0;
	cin >> n >> k;
	for (i = 0;i < n;i++)
		cin >> a[i];

	sort(a, a + n);
	if (n == 1)
	{
		cout << 2 << endl;
		return 0;
	}
	x = 2;
	for (i = 0;i < n;i++)
	{
		if (a[i + 1] - a[i] > 2 * k)
			x += 2;
		if (a[i + 1] - a[i] == 2 * k)
			x++;
	}
	cout << x  << endl;
	//system("pause");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#pragma warning (disable:4996)
void main()
{
	int n = 0, d = 0, i=0, result=2;
	scanf("%d %d", &n, &d);
	int *aoc = (int*)malloc(n*sizeof(int));
	for (i = 0; i < n; i++)
	{
		scanf("%d",&aoc[i]);
	}
	for (i = 0; i < n - 1; i++)
	{
		if ((aoc[i + 1] - aoc[i]) == 2*d)
		{
			result++;
		}
		else if ((aoc[i + 1] - aoc[i]) > d)
		{
			result = result + 2;
		}
	}
	printf("%d", result);
}


#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#pragma warning (disable:4996)
void main()
{
	int n = 0, d = 0, i=0, result=2;
	scanf("%d %d", &n, &d);
	int *aoc = (int*)malloc(n*sizeof(int));
	for (i = 0; i < n; i++)
	{
		scanf("%d",&aoc[i]);
	}
	for (i = 0; i < n - 1; i++)
	{
		if ((aoc[i + 1] - aoc[i]) == 2*d)
		{
			result++;
		}
		if ((aoc[i + 1] - aoc[i]) > 2 * d)
		{
			result=result+2;
		}
	}
	printf("%d", result);
	getchar();
	getchar();
}


#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<unordered_map>
#include<unordered_set>
#include<set>
#include<string>
#include<iostream>
using namespace std;

void Sonya_and_Hotels()
{
	int n;
	int d;
	cin >> n >> d;

	set<int> coord;
	set<int> addedPos;
	for (int i = 0; i < n;++i)
	{
		int x;
		cin >> x;
		coord.insert(x);
		for (int i = 0; i < d; ++i)
		{
			coord.insert(x + i);
			coord.insert(x - i);
		}

		addedPos.insert(x - d);
		addedPos.insert(x + d);

	}

	set<int>::iterator it;
	for (it = coord.begin(); it != coord.end(); ++it)
	{
		addedPos.erase(*it);
	}

	cout << addedPos.size();
}

int main() {
	Sonya_and_Hotels();
}


#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<unordered_map>
#include<unordered_set>
#include<set>
#include<string>
#include<iostream>
using namespace std;

void A_Sonya_and_Hotels()
{
	int n;
	int d;
	cin >> n >> d;

	set<int> coord;
	int addedPos=2;
	for (int i = 0; i < n;++i)
	{
		int x;
		cin >> x;
		coord.insert(x);

	}

	set<int>::iterator it=coord.begin(),it1;
	for ( ; it != --coord.end(); )
	{
		it1 = it;
		++it;
		int start = *it1+d, end = *it-d;

		if(end-start>0)
		{
			addedPos += 2;
		}
		else if(end-start==0)
		{
			++addedPos;
		}

	}

	cout << addedPos;
}
int main() {
	A_Sonya_and_Hotels();
}


#include<cstdio>

#include<iostream>

#include<string>

#include<cstring>

#include<cmath>

#include<algorithm>

using namespace std;

int main()

{

	int n, d, a, b, s = 2;

	int i;

	scanf("%d %d", &n, &d);

	scanf("%d", &a);

	for (i = 1; i<n; i++)

	{

		scanf("%d", &b);

		if (b - a - 2 * d > 0)

		{

			s += 2;

		}

		if (b - a - 2 * d == 0)

		{

			s += 1;

		}

		a = b;

	}

	printf("%d\n", s);

	return 0;

}


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

int main()
{
    long long a[100], n, k = 2, d;
    cin >> n >> d;
    for(int i = 0; i < n; i++)
        cin >> a[i];
    sort(a, a + n);
    for(int i = 1; i < n; i++)
    {
        if(a[i] - a[i - 1] >= 2 * d)
        {
            k++;
            if(a[i] - a[i - 1] > 2 * d)
                k++;
        }
    }
    cout << k;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include <cmath>

using namespace std;
bool myf2(pair<int, int>a, pair<int, int>b) {
	return a.second < b.second;
}
bool myf1(pair<int, int>a, pair<int, int>b) {
	return a.first > b.first;
}
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, d, ans = 2; cin >> n >> d;
	int a; cin >> a;
	for (int i = 1; i < n; i++) {
		int b; cin >> b;
		if (b - a == 2 * d)ans++;
		if (b - a > 2 * d)ans += 2;
		a = b;
	}
	cout << ans;
}


#include <iostream>
#include<algorithm>
#include<string>
#include<map>
#include <iterator>
#include<iomanip>
#include<vector>
#include<cmath>
#include <cstdio>
#include<queue>
#include<stack>
#include<list>
#include<stdio.h>
#include<set>
#include <functional>

#define mod 1000000007
#define mod2 30000000
#define pa(a,b) make_pair(a,b)
#define f first
#define s second
#define pb(a)  push_back(a)
#define all(a) a.begin() , a.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define LL  long long int
#define oo 1e9
#define pi 3.14159265359
#define eps  1e-9

LL maxx(LL a , LL b){ return a>b ?  a : b ;}
LL minn(LL a , LL b){ return a>b ?  b : a ;}

using namespace std;
int dx[] = {1 , 1 ,1 , 0 , 0  , -1 , -1  , -1  , 0 };
int dy[] = { -1 , 0  , 1 , 1 , -1 , 0 , 1 , -1 , 0 };
void boostIO()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
LL gcd(LL a, LL b) {
    return b == 0 ? a : gcd(b, a % b);
}
LL lcm(LL a , LL b )
{
    return (a*b)/gcd(a , b);
}
LL poww(LL base, LL exp){
  base %= mod;
  LL result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % mod;
    base = (base * base) % mod;
    exp >>= 1;
  }
  return result;
}
int main()
{
    int n , d ; cin >> n >> d ;
    int ans = 0 ;
    vector<int>a;
    for(int i = 0 ; i < n ; i++){
        int x; cin >> x ;
        a.pb(x) ;
    }
    sort(all(a)) ;

    for(int i = 0 ; i < n - 1 ; i++){
        if(a[i + 1] - a[i] == 2 * d){
            ans = ans + 1 ;
        }
        else if(a[i + 1] - a[i] > 2 * d){
            ans = ans + 2 ;
        }
    }

    cout << ans + 2 << endl ;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")

#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long double ld;
typedef long long ll;	// Use "%I64d" as placeholder with printf and scanf.
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef complex<double> cd;
typedef vector<cd> vcd;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef priority_queue<ll, vector<ll>, greater<ll>> min_heap_ll;
typedef priority_queue<ll, vector<ll>, less<ll>> max_heap_ll;

#define pi 3.141592653589793238462643383279502884197169399375105820974944592307816406286
#define f(i, n) for(ll i=0; i<n; ++i)
#define fi(i, n, j) for(ll i=j; i<n; ++i)
#define mp make_pair
#define all(container) container.begin(), container.end()
#define allr(container) container.rbegin(), container.rend()
#define tr(container, it) for (decltype(container.begin()) it = container.begin(); it != container.end(); it++)
#define trr(container, it) for (decltype(container.rbegin()) it = container.rbegin(); it != container.rend(); it++)
#define dist(a, b) sqrtl(powl(ld(a.first - b.first), 2) + powl(ld(a.second - b.second), 2))

// useful functions
ll gcd(ll a, ll b)
{
	return b ? gcd(b, a % b) : a;
}

ll my_exp(ll a, ll b, ll MOD = numeric_limits<ll>::max())
{
	a %= MOD;
	return b ? (((b % 2 == 1 ? a : 1) * my_exp(a * a, b / 2, MOD)) % MOD) : 1;
}

bool is_prime(ll n)	// O(sqrt(n)) implementation check for 0 and 1 separately
{
	if (n != 2 && n % 2 == 0) return false;
	else { for (ll i = 3; (i*i) <= n; i += 2) if (n%i == 0) return false; return true; }
}

// Program global variables

// Program classes and structs

// Program functions

int main()
{
#ifdef _CODE_SOURCE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	double start_time = clock();
#endif
	// Program Code
	ll n, d; cin >> n >> d;
	vll x(n); f(i, n) cin >> x[i];
	sort(all(x));
	ll ans = 2;
	f(i, n - 1)
	{
		if (x[i + 1] - x[i] > 2 * d)
		{
			ans += 2;
		}
		else if (x[i + 1] - x[i] == 2 * d)
		{
			ans += 1;
		}
	}
	cout << ans;

	// Program Code Ends
#ifdef _CODE_SOURCE
	double end_time = clock();
	printf("\nTime = %.3f seconds\n", (end_time - start_time) / CLOCKS_PER_SEC);
#endif
	return(0);
}


#include <iostream>
using namespace std;

int main()
{
	int n, d, citys;
	citys = 2;
	cin >> n >> d;
	int* hotels;
	hotels = new int[n];
	cin >> hotels[0];

	for (int i = 1; i<n; i++)
	{
		cin >> hotels[i];
		if (hotels[i] - hotels[i-1] == 2 * d)
			citys++;
		else if (hotels[i] - hotels[i-1] > 2 * d)
			citys+=2;
	}

	cout << citys;
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, d,citys;
	citys = 2;
	cin >> n>>d;
	int* hotels;
	hotels = new int[n];
	for (int i=0;i<n;i++)
	{
		cin >> hotels[i];
	}

	if (n > 1)
	{
		for (int j = 0; j < n - 1; j++)
		{
			if (hotels[j + 1] - hotels[j] == 2 * d)
				citys++;
			else if (hotels[j + 1] - hotels[j] > 2 * d)
				citys = citys + 2;
		}
	}
	cout << citys;
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, d,citys;
	citys = 0;
	cin >> n>>d;
	int* hotels;
	hotels = new int[n];
	for (int i=0;i<n;i++)
	{
		cin >> hotels[i];
	}

	if (hotels[0] - d >= 10 ^ -9) citys++;
	if(hotels[n-1]+d<=10^9) citys++;

	if (n > 1)
	{
		for (int j = 0; j < n - 1; j++)
		{
			if (hotels[j + 1] - hotels[j] == 2 * d)
				citys++;
			else if (hotels[j + 1] - hotels[j] > 2 * d)
				citys = citys + 2;
		}
	}
	cout << citys;
	return 0;
}


#include<iostream>
using namespace std;
typedef long long ll;
int main()
{
    ll time;
    ll dis;
    while(cin>>time>>dis)
    {
        ll count=0;
        ll b=0;
        for(int i=0;i<time;i++)
        {
            ll a;
            cin>>a;
            if(i==0)
            {
                b=a;
                count++;
                continue;
            }
            if((a-b)>(2*dis))
            {
                count+=2;
            }
            else if((a-b)==(2*dis))
                count++;
            b=a;

        }
        cout<<count+1<<endl;
    }
}


#include <iostream>

using namespace std;

int main() {
	int n, d, a, b, ans = 2;
	cin >> n >> d >> a;
	for (int i = 1; i < n; ++i) {
		cin >> b;
		ans += (b - a >= d * 2) + (b - a > d * 2);
		a = b;
	}
	cout << ans;
	return 0;
}


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

int main(){
	int n,d;
	cin >> n >> d;
	int a[n];
	for(int i = 0;i<n;i++){
		cin >> a[i];
	}
	int k = 2;
	int x = 1;
	for(int i = 0; i < n-1;i++){
		/*int x = abs(a[i] - a[i+1]) /d ;
		if(x > 1 && abs(a[i] - a[i+1]) > d*2) k = k + 2;
		if(d*d == abs(a[i] - a[i+1])) k--;*/
		if(abs(a[i]-a[i+1]) == d*2)k=k+1;
		if(abs(a[i]-a[i+1]) >d*2) k= k +2;

	}
	cout << k;

	return 0;
}


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

int main(){
	int n,m;
	cin >> n >> d;
	double a[n];
	for(int i = 0;i<n;i++){
		cin >> a[i];
	}
	int k = 2;
	int x = 1;
	for(int i = 0; i < n-1;i++){
		int x = abs(a[i] - a[i+1]) / d;
		if(x > 1) k = k + x;
	}
	cout << k;

	return 0;
}


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

int main(){
	int n,d;
	cin >> n >> d;
	double a[n];
	for(int i = 0;i<n;i++){
		cin >> a[i];
	}
	int k = 2;
	int x = 1;
	for(int i = 0; i < n-1;i++){
		int x = abs(a[i] - a[i+1]) / d;
		if(x > 1) k = k + x;
	}
	cout << k;

	return 0;
}


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

int main(){
	int n,d;
	cin >> n >> d;
	int a[n];
	for(int i = 0;i<n;i++){
		cin >> a[i];
	}
	int k = 2;
	int x = 1;
	for(int i = 0; i < n-1;i++){
		int x = abs(a[i] - a[i+1]) / d;
		if(x > 1) k = k + x;
	}
	cout << k;

	return 0;
}


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

int main(){
	int n,d;
	cin >> n >> d;
	int a[n];
	for(int i = 0;i<n;i++){
		cin >> a[i];
	}
	int k = 2;
	int x = 1;
	for(int i = 0; i < n-1;i++){
		int x = abs(a[i] - a[i+1]) / d;
		if(x > 1 && x*x != d) k = k + x;
	}
	cout << k;

	return 0;
}


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

int main(){
	int n,d;
	cin >> n >> d;
	int a[10000000];
	for(int i = 0;i<n;i++){
		cin >> a[i];
	}
	int k = 2;
	int x = 1;
	for(int i = 0; i < n-1;i++){
		/*int x = abs(a[i] - a[i+1]) /d ;
		if(x > 1 && abs(a[i] - a[i+1]) > d*2) k = k + 2;
		if(d*d == abs(a[i] - a[i+1])) k--;*/
		if(abs(a[i]-a[i+1]) == d*2)k=k+1;
		if(abs(a[i]-a[i+1]) >d*2) k= k +2;

	}
	cout << k;

	return 0;
}


#include <cstdio>

using namespace std;
int main(){

 int n,d;
 scanf("%d %d",&n,&d);

 int *x=new int [n];

 for(int i=0;i<n;i++)
     scanf("%d",&x[i]);

 int k=2;
 int sup=0,sp=0;
 for(int i=0;i<n-1;i++){
    sup=x[i]+d;
    sp=x[i+1]-d;
    if(sp>sup)k+=2;
    if(sp==sup)k++;
 }
 printf("%d",k);
return 0;
}


#include <cstdio>
#include <cmath>
using namespace std;
int main(){

 int n,d;
 scanf("%d %d",&n,&d);

 int *x=new int [n];

 for(int i=0;i<n;i++)
     scanf("%d",&x[i]);

 int k=0;

 if(abs(x[0])+d<1000000000)k++;
 if(x[n-1]+d<1000000000 )k++;
 int sup=0,sp=0;
 for(int i=0;i<n-1;i++){
    sup=x[i]+d;
    sp=x[i+1]-d;
    if(sp>sup)k+=2;
    if(sp==sup)k++;
 }
 printf("%d",k);
return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <queue>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <float.h>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vp;
typedef vector<string> vs;
typedef set<int> si;
typedef map<int, int> mi;
typedef multimap<int, int> mmi;
typedef map<int, vi> mivi;

int main()
{
	ios::sync_with_stdio(false);

	int n, d;
	cin >> n >> d;

	d <<= 1;

	vi x(n);
	for (int i = 0; i < n; ++i)
		cin >> x[i];

	sort(x.begin(), x.end());

	int res = 2;

	for (int i = 1; i < n; ++i)
	{
		int curr = x[i] - x[i - 1];
		if (curr > d)
			res += 2;
		else if (curr == d)
			++res;
	}

	cout << res << endl;

	return 0;
}


#include <iostream>
#include <string>
using namespace std;
int x[102],i,j,n,k,l,m,d,ans;
int main()
{
    cin>>n>>d;
    for(i=1;i<=n;i++)
    cin>>x[i];
    if(n==1)
    cout<<2<<endl;
    else
    {
        ans+=2;
        for(i=2;i<=n;i++)
        {
            if(x[i]-x[i-1]>=2*d+1)
            ans+=2;
            else if(x[i]-x[i-1]==2*d)
            ans++;
        }
        cout<<ans<<endl;
    }
}


#include<iostream>
using namespace std;
int main()
{
    int n, k, i, y, x, cnt=2;
    cin >> n >> k >> x;
    for (i=0; i<n-1; i++)
    {
        cin >> y;
        if((y-x)>=(2*k))
        {
            if((y-x)-(2*k)==0)
                cnt += 1;
            else cnt += 2;
       //     cout << cnt << "    ";

        }
         x = y;

    }

    cout << cnt << endl;
    return 0;

}


#include<iostream>
#include<set>
using namespace std;
int main()
{
    int n,d;
    cin>>n>>d;
    int *hotel=new int[n];
    for(int i=0;i<n;i++)
        cin>>hotel[i];
    set<int> newhotel;
    newhotel.insert(hotel[0]-d);
    if((hotel[1]-hotel[0])/2>=d)
        newhotel.insert(hotel[0]+d);
    for(int i=1;i<n-1;i++)
    {
        if((hotel[i]-hotel[i-1])/2>=d)
            newhotel.insert(hotel[i]-d);
        if((hotel[i+1]-hotel[i])/2>=d)
            newhotel.insert(hotel[i]+d);
    }
    if((hotel[n-1]-hotel[n-2])/2>=d)
        newhotel.insert(hotel[n-1]-d);
    newhotel.insert(hotel[n-1]+d);
    cout<<newhotel.size()<<endl;
}


#include <iostream>
#include <vector>
//#include <algorithm>
#include <cmath>

using namespace std;

int main() {
	int n, ans = 2;
	long int d;
	cin >> n >> d;
	vector<long int> country(n);
	for (int i = 0; i < n; ++i)
		cin >> country[i];
	for (int i = 0; i < n - 1; ++i) {
		if (abs(country[i] - country[i + 1]) > 2 * d) ans += 2;
		else if (abs(country[i] - country[i + 1]) == 2 * d) ans++;
	}
	cout << ans << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	int n, d, cnt = 0;
	cin >> n >> d;
	vector<int> input(n);
	for (int i = 0; i < input.size(); i++)
		cin >> input[i];
	for (int i = 0; i < input.size() - 1; i++)
	{
		if (input[i] + d == input[i + 1] - d)
			cnt++;
		else if (input[i] + d < input[i + 1] - d)
			cnt += 2;
	}
	cout << cnt + 2 << endl;
}


#include<iostream>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>

#define _CRT_SECURE_NO_WARNINGS
#define ll long long
#define ld long double

using namespace std;

ll a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;
ll ans = 2, mx = 0, mn = 1e9, sum = 0, cnt = 0, avr = 0, index = 0;

//map<int, int>freq;
vector<int>vec;
vector<int>res;
vector<int>freq(10000+5,0);
vector<int>cFreq(150, -1);

int main()
{
	cin >> n >> d;
	for (int i = 0; i < n; i++)
	{
		cin >> x;
		vec.push_back(x);
	}
	for (int i = 0; i < n; i++)
	{
		if (i + 1 >= n)break;
		cnt = 0;
		for (int j = vec[i]+d; j < vec[i+1]; j+=d)
		{
			cnt++;
		}
		if (cnt == 1)continue;
		ans += cnt;
	}
	cout << ans << endl;
	return 0;
}


#include<iostream>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>

#define _CRT_SECURE_NO_WARNINGS
#define ll long long
#define ld long double

using namespace std;

ll a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;
ll ans = 2, mx = 0, mn = 1e9, sum = 0, cnt = 0, avr = 0, index = 0;

//map<int, int>freq;
vector<int>vec;
vector<int>res;
vector<int>freq(10000+5,0);
vector<int>cFreq(150, -1);

int main()
{
	cin >> n >> d;
	for (int i = 0; i < n; i++)
	{
		cin >> x;
		vec.push_back(x);
	}
	for (int i = 0; i < n; i++)
	{
		if (i + 1 >= n)break;
		cnt = 0;
		if (vec[i + 1] - vec[i] > 2 * d)ans += 2;
		if (vec[i + 1] - vec[i] == 2 * d)ans++;
	}
	cout << ans << endl;
	return 0;
}


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

int main()
{
	int n, d, t = -2000000009, s, ans = 0;
	cin >> n >> d;
	cin >> t;
	for (int i = 0; i < n - 1; i++)
	{
		cin >> s;
		ans += min(2,max(0, s - t - 2 * d + 1));
		t = s;
	}
	ans += 2;
	cout << ans;
	//system("pause");
}


#include<iostream>

using namespace std;

int main()
{
	int n, d, t = -2000000009, s, ans = 0;
	cin >> n >> d;
	cin >> t;
	for (int i = 0; i < n - 1; i++)
	{
		cin >> s;
		ans += s - t - 2*d + 1;
		t = s;
	}
	ans += 2;
	cout << ans;
	//system("pause");
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <queue>
#include <stack>
#include <string.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp make_pair
#define pb push_back

void solve(){
    ll n,d;
    cin >> n >> d;
    vector<ll> a(n);
    for(int i = 0; i < n ;++i){
        cin >> a[i];
    }
    ll ans = 2;
    set<ll> used;
    used.insert(a[0] - d);
    used.insert(a[n - 1] + d);
    if(a[0] + 2 * d <= a[1] && !used.count(a[0] + d)){
        used.insert(a[0] + d);
        ans++;
    }
    if(a[n - 1] - 2 * d >= a[n - 2] && !used.count(a[n - 1] - d)){
            used.insert(a[n - 1] - d);
            ans++;
        }
    for(int i = 1; i < n - 1; ++i){
        if(a[i] + 2 * d <= a[i + 1] && !used.count(a[i] + d)){
            used.insert(a[i] + d);
            ans++;
        }
        if(a[i] - 2 * d >= a[i - 1] && !used.count(a[i] - d)){
            used.insert(a[i] - d);
            ans++;
        }
    }
    cout << ans;

}

int main() {
	ios_base::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(9);
	solve();
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <queue>
#include <stack>
#include <string.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp make_pair
#define pb push_back

void solve(){
    int n,d;
    cin >> n >> d;
    vector<int> a(n);
    for(int i = 0; i < n ;++i){
        cin >> a[i];
    }
    int ans = 2;
    set<int> used;
    used.insert(a[0] - d);
    used.insert(a[n - 1] + d);
    if(a[0] + 2 * d <= a[1] && !used.count(a[0] + d)){
        used.insert(a[0] + d);
        ans++;
    }
    if(a[n - 1] - 2 * d >= a[n - 2] && !used.count(a[n - 1] - d)){
            used.insert(a[n - 1] - d);
            ans++;
        }
    for(int i = 1; i < n - 1; ++i){
        if(a[i] + 2 * d <= a[i + 1] && !used.count(a[i] + d)){
            used.insert(a[i] + d);
            ans++;
        }
        if(a[i] - 2 * d >= a[i - 1] && !used.count(a[i] - d)){
            used.insert(a[i] - d);
            ans++;
        }
    }
    cout << ans;

}

int main() {
	ios_base::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(9);
	solve();
	return 0;
}