fork(1) download
  1. #include <bits/stdc++.h>
  2. #define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
  3. #define pb push_back
  4. #define show(x) cout<<(#x)<<" : "<<x<<endl;
  5. #define ll long long
  6. #define ld long double
  7. #define fill(a,val) memset(a,val,sizeof(a))
  8. #define mp make_pair
  9. #define ff first
  10. #define ss second
  11. #define pii pair<ll,ll>
  12. #define sq(x) ((x)*(x))
  13. #define all(v) v.begin(),v.end()
  14. #define rall(v) v.rbegin(),v.rend()
  15. const ll INF = 1ll*1000*1000*1000*1000*1000*1000 + 7;
  16. using namespace std;
  17.  
  18.  
  19. int main()
  20. {
  21. int T;
  22. cin>>T;
  23. while(T--)
  24. {
  25.  
  26. double n,d;
  27. ll flag=0;
  28. double z=0;
  29.  
  30. cin>>n>>d;
  31.  
  32. double x=sqrt(d);
  33.  
  34.  
  35. if (d<=n)
  36. flag=1;
  37. else
  38. {
  39.  
  40. z=int(x-1)+ceil(d/(int)x);
  41.  
  42. if (z<=n)
  43. flag=1;
  44.  
  45. }
  46.  
  47.  
  48.  
  49. if(flag==1)
  50. cout<<"YES"<<'\n';
  51. else
  52. cout<<"NO"<<'\n';
  53.  
  54.  
  55. }
  56. return 0;
  57. }
Success #stdin #stdout 0s 4168KB
stdin
1
998244353 999999998
stdout
YES