Language: C++

#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 1<<30
#define MOD 1000000007
#define mod 10007
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//----------------------------------------------------------------------
int dp[1<<21];
int cnt[21][100010];
int ccnt[21];
//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    ll a,b,c;cin>>a>>b>>c;
    ll ans=0;
    while(a%2==0&&b%2==0&&c%2==0){
        ll bb=a/2+c/2;
        ll aa=b/2+c/2;
        ll cc=a/2+b/2;
        ans++;
        a=aa;b=bb;c=cc;
        if(ans==1e6){
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------
































#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 1<<30
#define MOD 1000000007
#define mod 10007
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//----------------------------------------------------------------------
int dp[1<<21];
int cnt[21][100010];
int ccnt[21];
//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    ll a,b,c;cin>>a>>b>>c;
    ll ans=0;
    while(a%2==0&&b%2==0&&c%2==0){
        ll bb=a/2+c/2;
        ll aa=b/2+c/2;
        ll cc=a/2+b/2;
        ans++;
        a=aa;b=bb;c=cc;
        if(ans==1e6){
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------


































Compiler output:
a.cc:170:11: error: redefinition of 'long long int GCD(long long int, long long int)'
  170 | long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
      |           ^~~
a.cc:50:11: note: 'long long int GCD(long long int, long long int)' previously defined here
   50 | long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
      |           ^~~
a.cc:171:11: error: redefinition of 'long long int LCM(long long int, long long int)'
  171 | long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
      |           ^~~
a.cc:51:11: note: 'long long int LCM(long long int, long long int)' previously defined here
   51 | long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
      |           ^~~
a.cc:172:5: error: redefinition of 'int dx [4]'
  172 | int dx[4]={-1,0,1,0};
      |     ^~
a.cc:52:5: note: 'int dx [4]' previously defined here
   52 | int dx[4]={-1,0,1,0};
      |     ^~
a.cc:173:5: error: redefinition of 'int dy [4]'
  173 | int dy[4]={0,-1,0,1};
      |     ^~
a.cc:53:5: note: 'int dy [4]' previously defined here
   53 | int dy[4]={0,-1,0,1};
      |     ^~
a.cc:174:5: error: redefinition of 'int ddx [8]'
  174 | int ddx[8]={-1,0,1,0,1,1,-1,-1};
      |     ^~~
a.cc:54:5: note: 'int ddx [8]' previously defined here
   54 | int ddx[8]={-1,0,1,0,1,1,-1,-1};
      |     ^~~
a.cc:175:5: error: redefinition of 'int ddy [8]'
  175 | int ddy[8]={0,-1,0,1,1,-1,1,-1};
      |     ^~~
a.cc:55:5: note: 'int ddy [8]' previously defined here
   55 | int ddy[8]={0,-1,0,1,1,-1,1,-1};
      |     ^~~
a.cc:176:4: error: redefinition of 'll cmp(std::pair<long long int, long long int>, std::pair<long long int, long long int>)'
  176 | ll cmp(pair<ll,ll>a,pair<ll,ll> b){
      |    ^~~
a.cc:56:4: note: 'll cmp(std::pair<long long int, long long int>, std::pair<long long int, long long int>)' previously defined here
   56 | ll cmp(pair<ll,ll>a,pair<ll,ll> b){
      |    ^~~
a.cc:183:5: error: redefinition of 'int dp [2097152]'
  183 | int dp[1<<21];
      |     ^~
a.cc:63:5: note: 'int dp [2097152]' previously declared here
   63 | int dp[1<<21];
      |     ^~
a.cc:184:5: error: redefinition of 'int cnt [21][100010]'
  184 | int cnt[21][100010];
      |     ^~~
a.cc:64:5: note: 'int cnt [21][100010]' previously declared here
   64 | int cnt[21][100010];
      |     ^~~
a.cc:185:5: error: redefinition of 'int ccnt [21]'
  185 | int ccnt[21];
      |     ^~~~
a.cc:65:5: note: 'int ccnt [21]' previously declared here
   65 | int ccnt[21];
      |     ^~~~
a.cc:187:5: error: redefinition of 'int main()'
  187 | int main(){
      |     ^~~~
a.cc:67:5: note: 'int main()' previously defined here
   67 | int main(){
      |     ^~~~