-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path1368A - C+=.cpp
More file actions
46 lines (42 loc) · 807 Bytes
/
1368A - C+=.cpp
File metadata and controls
46 lines (42 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// ॐ नमः शिवाय
#include<bits/stdc++.h>
using namespace std;
#define ll long long
// Code Written By: Vikash Patel
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
int main()
{
int t;
cin>>t;
while(t--)
{
int a,b,n;
cin>>a>>b>>n;
int t = a;
int c =0;
if(a<b)
{
t = a;
a = b;
b = t;
}
while(true)
{
if(c%2==0)
{
b += a;
t = b;
}
else
{
a += b;
t = a;
}
c++;
if(t>n)
break;
}
cout<<c<<endl;
}
return 0;
}