Problem:


Score : 300 points

Problem Statement

Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below:

Each person simultaneously divides his cookies in half and gives one half to each of the other two persons.

This action will be repeated until there is a person with odd number of cookies in hand.

How many times will they repeat this action?
Note that the answer may not be finite.

Constraints

1 ≤ A,B,C ≤ 10^9

Input

Input is given from Standard Input in the following format:

A B C

Output

Print the number of times the action will be performed by the three people, if this number is finite.
If it is infinite, print -1 instead.

Sample Input 1

4 12 20

Sample Output 1

3

Initially, Takahashi, Aoki and Snuke have 4, 12 and 20 cookies. Then,

After the first action, they have 16, 12 and 8.

After the second action, they have 10, 12 and 14.

After the third action, they have 13, 12 and 11.

Now, Takahashi and Snuke have odd number of cookies, and therefore the answer is 3.

Sample Input 2

14 14 14

Sample Output 2

-1

Sample Input 3

454 414 444

Sample Output 3

1



Sample input:
4 12 20


Sample output:
3

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        L=list(map(int,input().split()))
        if L[0]==L[1] and L[1]==L[2]:
            return -1
        S=sum(L)
        cnt=0
        while True:
            for i in range(3):
                if (S-L[i])%2==0:
                    L[i]=(S-L[i])//2
                else:
                    return cnt
            cnt+=1
    print(main())


resolve()

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = 0
if a == b == c and a%2 == 0:
    print(-1,-1,-1)
    exit()
while a%2 == b%2 == c%2 == 0:
    x,y,z = a//2, b//2, c//2
    a = y + z
    b = x + z
    c = x + y
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
x = input().split()
t = int(x[0]) / 2
a = int(x[1]) / 2
s = int(x[2]) / 2
t_after = a + s
a_after = t + s
s_after = t + a
t_amari = t_after % 2
a_amari = a_after % 2
s_amari = s_after % 2
count = 0
while True:
  count =+ 1
  if t_amari != 0 or a_amari != 0 or s_amari != 0:
    break
  elif t == a and a == s:
    count = -1
    break
print(count)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

ans = 0
for i in range(10000):
    if a == b == c:
        print(-1)
        break
    if (a + 1) * (b + 1) * (c + 1) % 2 == 0:
        print(ans)
        break
    ans += 1
    a, b, c = a // 2, b // 2, c // 2
    a, b, c = b + c, a + c, b + c

Submission status: Wrong Answer

Solution code:
cnt=0
a,s,d=map(int,input().split())
if a==s==d:print(-1);exit()
while a%2==s%2==d%2==0:
    a,s,d=(s+d)//2,(a+d)//2,(a+s)//2
    cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ans=0
if a==b==c:
    print ("-1")
else:
    while a%2==0 and b%2==0 and c%2==0:
        ta=(b//2)+(c//2)
        tb=(a//2)+(c//2)
        tc=(a//2)+(b//2)
        a,b,c=ta,tb,tc
        ans+=1
    print (ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ans=0
if a==b==c:
    print ("-1")
else:
    while a%2==0 and b%2==0 and c%2==0:
        ta,tb,tc=a,b,c
        a=(tb//2)+(tc//2)
        b=(ta//2)+(tc//2)
        c=(ta//2)+(tb//2)
        ans+=1
    print (ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ans=0
if a==b==c:
    print ("-1")
else:
    while a%2==0 and b%2==0 and c%2==0:
        ta=a
        tb=b
        tc=c
        a=(tb/2)+(tc/2)
        b=(ta/2)+(tc/2)
        c=(ta/2)+(tb/2)
        ans+=1
    print (ans)

Submission status: Wrong Answer

Solution code:
x = list(map(int,input().split()))
point = 0
def count(x,point):
    if x[0]%2 == 1 or x[1]%2 == 1 or x[2]%2 == 1:
        return(point)
    else:
        point += 1
        x = [(x[0]+x[1])/2,(x[0]+x[2])/2, (x[1]+x[2])/2]
        return(count(x,point))

if x[0] == x[1] == x[2]:
    print(-1)
else:
    print(count(x,point))

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
from functools import lru_cache, reduce
INF = 1 << 60
mod = 1000000007
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# ここから書き始める
a, b, c = map(int, input().split())
if a == b == c:
    print(-1)
else:
    ans = 0
    while True:
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        copy_a = a
        copy_b = b
        copy_c = c
        a = copy_b // 2 + copy_c // 2
        b = copy_a // 2 + copy_c // 2
        c = copy_a // 2 + copy_b // 2
        ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,itertools,math,numpy,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
A,B,C = LI()
ans = 0
if A==B==C:
    ans = -1
else:
    while 1:
        if A%2 or B%2 or C%2:
            break
        A,B,C = (B+C)//2,(A+C)//2,(A+B)//2
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,itertools,math,numpy,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
A,B,C = LI()
ans = 0
if A==B==C:
    ans = -1
else:
    while 1:
        A,B,C = (B+C)//2,(A+C)//2,(A+B)//2
        ans += 1
        if A%2 or B%2 or C%2:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())

cnt = 0
if(A==B==C):
    print("-1")
else:
    while(A%2 == 0 and B%2 == 0 and C%2 == 0):
        tmpA = A
        tmpB = B
        tmpC = C
        cnt += 1
        A = tmpB//2+tmpC//2    
        B = tmpA//2+tmpC//2
        C = tmpA//2+tmpB//2
    print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
A,B,C = map(int,input().split())
result = 0
if A == B and B == C:
  print(-1)
  sys.exit()
else:
  while A % 2 == B % 2 and B % 2 == C % 2 and C % 2 == 0:
    a = (B + C) // 2
    b = (C + A) // 2
    c = (A + B) // 2
    A,B,C = a,b,c
    result += 1
print(result)

Submission status: Wrong Answer

Solution code:
import sys
A,B,C = map(int,input().split())
result = 0
if A == B and B == C:
  print(-1)
else:
  while A % 2 == B % 2 and B % 2 == C % 2 and C % 2 == 0:
    a = (B + C) // 2
    b = (C + A) // 2
    c = (A + B) // 2
    A,B,C = a,b,c
    result += 1
print(result)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

if (a == b ) and (b == c):
  print(-1)
elif (a%2!=0) or (b%2!=0) or (c%2!=0):
  print(-1)
else:
  def exchange(a,b,c):
    return (b+c)/2,(c+a)/2,(a+b)/2
  num = 0
  ans = 0
  while num  == 0:
    a,b,c = exchange(a,b,c)
    ans += 1
    for j in range(3):
      if [a,b,c][j] % 2 ==1:
        num = 1
  print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

if (a == b ) and (b == c):
  print(-1)
elif (a%2!=0) and(b%2!=0) and(c%2!=0):
  print(-1)
else:
  def exchange(a,b,c):
    return (b+c)/2,(c+a)/2,(a+b)/2
  num = 0
  ans = 0
  while num  == 0:
    a,b,c = exchange(a,b,c)
    ans += 1
    for j in range(3):
      if [a,b,c][j] % 2 ==1:
        num = 1
  print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

if (a == b ) and (b == c):
  print(-1)
else:
  def exchange(a,b,c):
    return (b+c)/2,(c+a)/2,(a+b)/2
  num = 0
  ans = 0
  while num  == 0:
    a,b,c = exchange(a,b,c)
    ans += 1
    for j in range(3):
      if [a,b,c][j] % 2 ==1:
        num = 1
  print(ans)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, C = MAP()

if A == B == C:
	print(-1)
	exit()
ans = 0
while A%2 == 0 and B%2 == 0 and C%2 == 0:
	A, B, C = (B+C)//2, (A+C)//2, (A+B)//2
	ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
a,b,c = iim()
count = 0
if a == b == c:
    print(-1)
    exit()

while a%2 == 0 and b%2 == 0 and c%2 == 0:
    ta = a
    tb = b
    tc = c
    a = (tb+tc)//2
    b = (tc+ta)//2
    c = (ta+tb)//2
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

A,B,C = imn()

count = 1
for i in range(10**6):
    a = A
    b = B
    c = C

    A = b//2 + c//2
    B = a//2+ c//2
    C = a//2 + b//2

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: break
    count += 1
else:
    count = -1
print(count)

Submission status: Wrong Answer

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

A,B,C = imn()

count = 1
for i in range(10**7):
    a = A
    b = B
    c = C

    A = b//2 + c//2
    B = a//2+ c//2
    C = a//2 + b//2

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: break
    count += 1
else:
    count = -1
print(count)

Submission status: Wrong Answer

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

A,B,C = imn()

count = 1
for i in range(100):
    a = A
    b = B
    c = C

    A = b//2 + c//2
    B = a//2+ c//2
    C = a//2 + b//2

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: break
    count += 1
else:
    count = -1
print(count)

Submission status: Wrong Answer

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

A,B,C = imn()

count = 1
for i in range(10):
    a = A
    b = B
    c = C

    A = b//2 + c//2
    B = a//2+ c//2
    C = a//2 + b//2

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: break
    count += 1
else:
    count = -1
print(count)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())

if A==B==C:
    print(-1)
    exit()

ans = 0
while A%2==0 and B%2==0 and C%2==0:
    tmpA = A//2
    tmpB = B//2
    tmpC = C//2
    A = tmpB+tmpC
    B = tmpC+tmpA
    C = tmpA+tmpB
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    a, b, c = map(int, input().split())

    count = 0
    while True:
        count += 1
        i, j, k = a / 2, b / 2, c / 2
        a, b, c = j + k, k + i, i + j

        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            print(count)
            break
        elif a == b == c:
            print(-1)
            break


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
cnt=0

if A==B==C:
  cnt=-1
else:
  while A%2==0 and B%2==0 and C%2==0:
    s=A//2
    t=B//2
    u=C//2
    A=t+u
    B=u+s
    C=s+t
    cnt +=1
    
print(cnt)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())


def solve(n):
    i = 0
    while(n % 2 == 0):
        n = n // 2
        i += 1
    return(i)


a = solve(A+B)
b = solve(B+C)
c = solve(C+A)
if a == b and b == c:
    print(-1)
else:
    print(min(a, b, c))

Submission status: Wrong Answer

Solution code:
nums = map(int, input().split())
nums = sorted(nums)
A, B, C = nums

if A == B and B == C:
    print(-1)
    exit()

count = 0
while True:
    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(count)
        exit()

    newA = (A + B) // 2
    newB = (B + C) // 2
    newC = (C + A) // 2
    A = newA
    B = newB
    C = newC
    count += 1

Submission status: Wrong Answer

Solution code:
#coding uft-8
import copy
a, b, c = map(int,input().split())

def solve(a,b,c):
    ans = 0
    while True:
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            return ans
        else:
            s = copy.copy(a)
            t = copy.copy(b)
            u = copy.copy(c)
            a = t//2 + u//2
            b = s//2 + u//2
            c = s//2 + t//2
            ans += 1

        

if len(set([a,b,c])) == 1:
    print(-1)
else:
    print(solve(a,b,c))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
# input = sys.stdin.r/eadline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    A,B,C = MAP()
    if A==B==C:
        print(-1)
        return
    answer = 0
    
    while A%2==0 and B%2==0 and C%2==0:
        x = A//2
        y = B//2
        z = C//2
        A = y+z
        B = x+z
        C = y+x
        answer += 1
    print(answer)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
# input = sys.stdin.r/eadline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    A,B,C = MAP()
    # if not (A%2==0 and B%2==0 and C%2==0):
    #     print(0)
    #     return

    if A==B==C:
        print(-1)
        return
    answer = 0
    
    while A%2==0 and B%2==0 and C%2==0:
        x = A//2
        y = B//2
        z = C//2
        A = y+z
        B = x+y
        C = y+z
        answer += 1
    print(answer)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    cookies = list(map(int, input().split()))
    answer = 0
    if cookies[0] == cookies[1] == cookies[2]:
        answer = -1
    elif all(cookies[i] % 2 == 0 for i in range(3)):
        half = [0, 0, 0]
        sum_cookies = sum(cookies)
        while all(cookies[i] % 2 == 0 for i in range(3)):
            for i in range(3):
                half[i] = (sum_cookies - cookies[i]) // 2
            cookies[0] = half[1] + half[2]
            cookies[1] = half[0] + half[2]
            cookies[2] = half[1] + half[0]
            answer += 1
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from functools import reduce
from fractions import gcd


def main():
    cookies = list(map(int, input().split()))
    answer = -1
    if cookies[0] % 2 or cookies[1] % 2 or cookies[2] % 2:
        answer = 0
    elif len(set(cookies)) > 1:
        answer = reduce(gcd, cookies) - 1
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())


def cnt(N):
    cnt = 0
    while N % 2 == 0:
        cnt += 1
        N //= 2

    return cnt


if A == B == C and A % 2 == 0:
    print(-1)
elif len(set([cnt(A), cnt(B), cnt(C)])) == 1:
    print(min(cnt(A), cnt(B), cnt(C)) + 1)
else:
    print(min(cnt(A), cnt(B), cnt(C)))

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())


def cnt(N):
    cnt = 0
    while N % 2 == 0:
        cnt += 1
        N //= 2

    return cnt


if A == B == C and A % 2 == 0:
    print(-1)
elif len(set([cnt(A), cnt(B), cnt(C)])) <= 2:
    print(min(cnt(A), cnt(B), cnt(C)))
else:
    print(min(cnt(A), cnt(B), cnt(C)) + 1)

Submission status: Wrong Answer

Solution code:
# 解答AC

A,B,C = map(int, input().split())

is_even = lambda n: True if n % 2 == 0 else False

if A == B == C:
    if A % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    cnt = 0
    while True:
        cnt += 1
        A,B,C = (B + C) // 2, (A + C) // 2, (A + B) // 2
        if is_even(A) and is_even(B) and is_even(C):
            continue
        break
    print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
na = nb = nc = 0
cnt = 0
if a == b == c:
    print(-1)
else:
    while a%2==0 and b%2==0 and c%2==0:
        na = (b+c)//2
        nb = (c+a)//2
        nc = (a+b)//2
        cnt += 1
        a,b,c = na,nb,nc
    print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
lst = [a,b,c]
lst.sort()
if a==b==c:
    print(-1)
else:
    res = 0
    while True:
        if (a%2!=0 or b%2!=0 or c%2!=0) or (a==0 or b==0 or c==0):
            break
        else:
            res += 1
            nx_a = b//2 + c//2
            nx_b = a//2 + c//2
            nx_c = a//2 + b//2
            tmp = [nx_a, nx_b, nx_c]
            tmp.sort()
            if tmp==lst:
                res=-1
                break
            a,b,c = nx_a, nx_b, nx_c
    print(res)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
if a==b==c:
    print(-1)
else:
    res = 0
    while True:
        if (a%2!=0 or b%2!=0 or c%2!=0) or (a==0 or b==0 or c==0):
            break
        else:
            res += 1
            nx_a = b//2 + c//2
            nx_b = a//2 + c//2
            nx_c = a//2 + b//2
            a,b,c = nx_a, nx_b, nx_c
    print(res)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
if a==b==c:
    print(-1)
else:
    res = 0
    while True:
        if a%2!=0 or b%2!=0 or c%2!=0:
            break
        else:
            res += 1
            nx_a = b//2 + c//2
            nx_b = a//2 + c//2
            nx_c = a//2 + b//2
            a,b,c = nx_a, nx_b, nx_c
    print(res)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
cnt = 0
if a == b and b == c:
  print(-1)
  exit()
while cnt >= 0:
  if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
    print(cnt)
    exit()
  else:
    a1 = (b + c) // 2
    b1 = (a + c) // 2
    c1 = (a + b) // 2
    a = a1
    b = b1
    c = c1
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
if A==B and B==C:
    print(-1)
elif A%2==1 or B%2==1 or C%2==1:
    print(0)
else:
    ans=0
    flag=0
    d=0
    while flag==0:
        if (A>>d &1)==(B>>d &1) and (C>>d &1)==(B>>d &1):
            d+=1
        else:
            ans=d
            break
    print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
if A==B and B==C:
    print(-1)
else:
    ans=0
    flag=0
    d=0
    while flag==0:
        if (A>>d &1)==(B>>d &1) and (C>>d &1)==(B>>d &1):
            d+=1
        else:
            ans=d
            break
    print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
if (A==B)and(B==C):
    print("-1")
else:
    count=0
    while True:
        if (A%2==0)and(B%2==0)and(C%2==0):
            a=(B+C)/2
            b=(A+C)/2
            c=(A+B)/2
            A=a
            B=b
            C=c
            count=count+1
        else:
            break
    print(count)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
cnt = 0
flag_cnt=0
while(1):
    A_tmp = A
    B_tmp = B
    C_tmp = C
    A = (B_tmp+C_tmp)/2
    B = (A_tmp+C_tmp)/2
    C = (A_tmp+C_tmp)/2
    cnt += 1
    if A%2!=0 or B%2!=0 or C%2!=0:
        break
    if A_tmp==A and B_tmp==B and C_tmp==C:
        flag_cnt+=1
        if flag_cnt==2:
            cnt = -1
            break
print(cnt)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
cnt = 0
while(1):
    A_tmp = A
    B_tmp = B
    C_tmp = C
    A = (B_tmp+C_tmp)/2
    B = (A_tmp+C_tmp)/2
    C = (A_tmp+C_tmp)/2
    cnt += 1
    if A%2!=0 or B%2!=0 or C%2!=0:
        break
    if A_tmp==A and B_tmp==B and C_tmp==C:
        cnt = -1
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a==b and b==c:
    print(-1)
else:
    ans=0
    while a%2==0 and b%2==0 and c%2==0:
        a0,b0,c0=(b+c)//2,(c+a)//2,(a+b)//2
        a,b,c=a0,b0,c0
        ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

a, b, c = map(int, input().split())
n_a, n_b, n_c = 0, 0, 0
ans = 0

if a == b == c:
    print(-1)
    exit()

elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    for i in range(10 ** 5):
        n_a = b // 2 + c // 2
        n_b = a // 2 + c // 2
        n_c = a // 2 + b // 2

        if n_a % 2 == 0 and n_b % 2 == 0 and n_c % 2 == 0:
            ans += 1
        else:
            ans += 1
            break

        a = n_a
        b = n_b
        c = n_c

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

a, b, c = map(int, input().split())
n_a, n_b, n_c = 0, 0, 0
ans = 0

if a == b == c:
    print(-1)
    exit()

for i in range(10 ** 5):
    n_a = b // 2 + c // 2
    n_b = a // 2 + c // 2
    n_c = a // 2 + b // 2

    if n_a % 2 == 0 and n_b % 2 == 0 and n_c % 2 == 0:
        ans += 1
    else:
        ans += 1
        break

    a = n_a
    b = n_b
    c = n_c

print(ans)

Submission status: Wrong Answer

Solution code:
cookie = list(map(int,input().split()))

if len(set(cookie)) == 1:
  print(-1)
else:
  con = 0
  while True:
    a = cookie[0] // 2
    b = cookie[1] // 2
    c = cookie[2] // 2
    cookie[0] = b + c
    cookie[1] = c + a
    cookie[2] = a + b
    con += 1
    if any([i % 2 != 0 for i in cookie]):
      break

  print(con)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
za = 0
zb = 0
zc = 0

d = 0

if a == b == c:
    print(-1)
    exit()
elif not(a % 2 == 0 and b % 2 == 0 and c % 2 ==0):
    print(0)
    exit()


while a % 2 == 0 and b % 2 == 0 and b % 2 == 0:

    za = a
    zb = b
    zc = c

    a = zb // 2 + zc // 2
    b = za // 2 + zc // 2
    c = za // 2 + zb // 2

    d += 1

print(d)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
za = a
zb = b
zc = c

d = 0

if a == b == c:
    print(-1)
    exit()
elif not(a % 2 == 0 and b % 2 == 0 and c % 2 ==0):
    print(0)
    exit()

while True:
    a = int(zb / 2) + int(zc / 2)
    b = int(za / 2) + int(zc / 2)
    c = int(za / 2) + int(zb / 2)

    za = a
    zb = b
    zc = c

    d += 1

    if a % 2 != 0 or b % 2 != 0 or b % 2 != 0:
        print(d)
        exit()