We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a542c04 commit 07e21ebCopy full SHA for 07e21eb
1368A - C+=.cpp
@@ -0,0 +1,46 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define ll long long
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+int main()
10
+{
11
+ int t;
12
+ cin>>t;
13
+ while(t--)
14
+ {
15
+ int a,b,n;
16
+ cin>>a>>b>>n;
17
+ int t = a;
18
+ int c =0;
19
+ if(a<b)
20
21
+ t = a;
22
+ a = b;
23
+ b = t;
24
+ }
25
+ while(true)
26
27
+ if(c%2==0)
28
29
+ b += a;
30
+ t = b;
31
32
+ else
33
34
+ a += b;
35
36
37
+ c++;
38
+ if(t>n)
39
+ break;
40
41
42
+ cout<<c<<endl;
43
44
+ return 0;
45
+}
46
0 commit comments