fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. ios_base::sync_with_stdio(0); cin.tie(NULL);
  6. int n;
  7. int r;
  8. int w;
  9. int x=0;
  10. cin>>n;
  11. for(int i=0;i<n;i++)
  12. {
  13. cin>>r;
  14. cin>>w;
  15. while(r<w)
  16. {
  17. r=2*r;
  18. x+=1;
  19. }
  20. cout<<x<<"\n";
  21. x=0;
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 15232KB
stdin
2
3 4
2 6
stdout
1
2