For this Question: You have two numbers X and Y in one operation you can replace either of the numbers to their sum i.e in one operation you can either have (X+Y, Y) or (X, X+Y).
Find the minimum number of operations it takes to transform one of the numbers to N. Assuming initial value of X and Y are (1, 1).The input contains a single integer N.

Constraints:-
1 <= N <= 1000000Print the minimum number of operations required.Sample Input
5

Sample Output
3

Explanation
(1, 1) -> (2, 1) -> (2, 3) -> (2, 5)

Sample Input
1

Sample Output
0, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
 
int count_gcd(int a, int b) 
{ 
	if(a==1)
		return b-1; 
	if(a>b)
		return count_gcd(b, a);
	if(b%a)
		return b/a + count_gcd(b%a, a); 
	else
		return 1e9;
}
 
int n;
 
int32_t main()
{
	IOS;
	cin>>n;
	if(n==1)
	{
		cout<<"0";
		return 0;
	}
	int ans=1e9;
	for(int i=1;i<n;i++)
		ans=min(ans, count_gcd(i, n));
	cout<<ans;
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?