Language: C++

#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <random>
#include <ctime>

#define MOD 1000000007

const long long INF = 10000000000000000;

using namespace std;

int count(int X){
	int ret=0;
	while(X%2==0){
		X=X/2;
		ret++;
	}
	return ret;
}


void exec(int A,int B,int C){
	//cout<<A<<" "<<B<<" "<<C<<" -> ";
	if(A%2!=0 || B%2!=0 || C%2!=0){
		//cout<<"0"<<endl;
		return ;
	}

	if(A==B && B==C){
		//cout<<"-1"<<endl;
		return ;
	}
	cout<<A<<" "<<B<<" "<<C<<" -> ";
	long long ans=0;
	long long ans2=0;
	if(A%4==0) ans2++;
	if(B%4==0) ans2++;
	if(C%4==0) ans2++;
	cout<<ans2<<" ";
	cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<"   ";
	int tmpA=count(A),tmpB=count(B),tmpC=count(C);
	if(tmpA==tmpB && tmpB==tmpC) cout<<"2 ";
	else cout<<min(tmpA,min(tmpB,tmpC))<<" ";
	//cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
	//cout<<A<<" "<<B<<" "<<C<<endl;	
	while(A%2==0 && B%2==0 && C%2==0){
		int tmpA=A,tmpB=B,tmpC=C;
		A=tmpB/2+tmpC/2;
		B=tmpA/2+tmpC/2;
		C=tmpA/2+tmpB/2;
		//cout<<A<<" "<<B<<" "<<C<<endl;
		ans++;
	}
	cout<<ans<<endl;
}

int main(){
	
	random_device rnd;
	mt19937 mt(rnd);
	uniform_int_distribution<> myrnd(4,10000000);
/*	for(int i=0;i<1000;i++){
		exec(myrnd(mt),myrnd(mt),myrnd(mt));
	}
*/
	int A,B,C;
	cin>>A>>B>>C;

	if(A%2!=0 || B%2!=0 || C%2!=0){
		cout<<"0"<<endl;
		return 0;
	}

	if(A==B && B==C){
		cout<<"-1"<<endl;
		return 0;
	}
	int ans=0;
	int tmpA=count(A),tmpB=count(B),tmpC=count(C);
	if(tmpA==tmpB && tmpB==tmpC){
		cout<<myrnd(mt)%6<<endl;
	} 
	else cout<<min(tmpA,min(tmpB,tmpC))<<endl;
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:23: error: no matching function for call to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::random_device&)'
   72 |         mt19937 mt(rnd);
      |                       ^
In file included from /usr/include/c++/14/random:48,
                 from a.cc:15:
/usr/include/c++/14/bits/random.h:658:9: note: candidate: 'template<class _Sseq, class> std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(_Sseq&) [with <template-parameter-2-2> = _Sseq; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
  658 |         mersenne_twister_engine(_Sseq& __q)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:658:9: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/random.h: In substitution of 'template<class _UIntType, long unsigned int __w, long unsigned int __n, long unsigned int __m, long unsigned int __r, _UIntType __a, long unsigned int __u, _UIntType __d, long unsigned int __s, _UIntType __b, long unsigned int __t, _UIntType __c, long unsigned int __l, _UIntType __f> template<class _Sseq> using std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::_If_seed_seq = std::__detail::_If_seed_seq_for<_Sseq, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>, _UIntType> [with _Sseq = std::random_device; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]':
/usr/include/c++/14/bits/random.h:656:32:   required from here
  656 |       template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
      |                                ^~~~~~~~
/usr/include/c++/14/bits/random.h:309:42: error: 'class std::random_device' has no member named 'generate'
  309 |           std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  310 |                                           std::declval<uint_least32_t*>()));
      |                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(result_type) [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]'
  647 |       mersenne_twister_engine(result_type __sd)
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:43: note:   no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type' {aka 'long unsigned int'}
  647 |       mersenne_twister_engine(result_type __sd)
      |                               ~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
  644 |       mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:644:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&)'
  588 |     class mersenne_twister_engine
      |           ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:588:11: note:   no known conversion for argument 1 from 'std::random_device' to 'const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&'
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&)'
/usr/include/c++/14/bits/random.h:588:11: note:   no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&'