ho 10 punti cosa posso migliorare ?
#include <iostream>
#include <fstream>
using namespace std;
int N; int k=0;
int f(int n, int m){
if ((n==1) &&( m== 1) ) return 0;
else {
while ((n!=1) && (m!=1))
{ if ((n%2==0)&&(m%2==0))
{n=(int)n/2;
m=(int)m/2;
k++;
}
else
if((n%2!=0)&&(m%2!=0)) {
n=2*n+1;
m=2*m+1;
k++; }
else
if(n%2!=0) {
n=n+3;
k=k+1;
}
else
{m=m+3;
k=k+1;
}
}
}
return k;
}
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int A,B;int k;
cin >> A>>B;
cout<<f(A,B);
return 0;
}