Saleh127

cf 1368A

Jun 18th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. Faster
  9. test
  10. {
  11. ll n,a,c,d=0,e,f,i,j,k,l;
  12. cin>>a>>c>>n;
  13.  
  14. while(a<=n && c<=n)
  15. {
  16. if(a<c)
  17. {
  18. a+=c;
  19. d++;
  20. }
  21. else
  22. {
  23. c+=a;
  24. d++;
  25. }
  26. }
  27. cout<<d<<endl;
  28. }
  29.  
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment