Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define fast() (ios_base::sync_with_stdio(0),cin.tie(NULL));
- int main()
- {
- fast();
- int t;
- cin>>t;
- while(t--)
- {
- int h,p;
- cin>>h>>p;
- while(p>0)
- {
- h-=p;
- if(h<=0)break;
- p/=2;
- }
- if(p>0)cout<<"1"<<endl;
- else cout<<"0"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement