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:
#ABC014-A
abc = list(map(int,input().split()))

cnt = 0

while True:
    prev = abc[:]
    tmp = [abc[0]//2,abc[1]//2,abc[2]//2]
    cnt += 1
    abc = [tmp[1]+tmp[2],tmp[0]+tmp[2],tmp[0]+tmp[1]]
    
    if abc[0] == prev[0] and abc[1] == prev[1] and abc[2] == prev[2]:
        cnt = -1
        break
    elif abc[0] % 2 != 0 or abc[1] % 2 != 0 or abc[2] % 2  != 0:
        break
    else:
        continue
        
    
        
print(cnt)

Submission status: Wrong Answer

Solution code:
#ABC014-A
abc = list(map(int,input().split()))

cnt = 0

while True:
    prev = abc[:]
    tmp = [abc[0]//2,abc[1]//2,abc[2]//2]
    cnt += 1
    abc = [tmp[1]+tmp[2],tmp[0]+tmp[2],tmp[0]+tmp[1]]
    
    if abc[0] == prev[0] and abc[1] == prev[1] and abc[2] == prev[2]:
        cnt = -1
        break
    elif abc[0] % 2 == 0 and abc[1] % 2 == 0 and abc[2] % 2  == 0:
        print(*abc)
        
    else:
        break
        
    
        
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
done = set((a, b, c))
while True:
    ans += 1
    s = a // 2
    t = b // 2
    u = c // 2
    a, b, c = t + u, s + u, s + t
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(ans)
        break
    if (a, b, c) in done:
        print(-1)
        break
    else:
        done.add((a, b, c))

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True

def func(a):
    b = []
    for ai in a:
        for j in reversed(range(30)):
            if (ai >> j) * 2 ** j == ai:
                b.append(j)
                break
    return b

a = LIST()
if len(set(a)) == 1 and not a[0] % 2:
    print(-1)
    exit()
b = func(a)
ans = 0
while True:
    tmp = [0, 0, 0]
    for i in range(3):
        for j in range(3):
            if i == j:
                continue
            tmp[i] += a[j] // 2
    a = tmp
    b = func(a)
    ans += 1
    if 0 in b:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c =map(int, input().split())
i,j,k = a,b,c
X=0
if a ==b and b ==c:
  print('-1')
  exit()
else:
  while i%2 ==0 and j%2==0 and k%2==0:
    i = (b+c)/2
    j = (c+a)/2
    k = (a+b)/2
    a,b,c = i,j,k
    X +=1
print(X)

Submission status: Wrong Answer

Solution code:
a, b, c =map(int, input().split())
if a ==b and b ==c:
  print('-1')
  exit()
X = 0
i,j,k = a,b,c
while i%2 ==0 and j%2==0 and k%2==0:
  i = (b+c)/2
  j = (c+a)/2
  k = (a+b)/2
  a,b,c = i,j,k
  X +=1
print(X)

Submission status: Wrong Answer

Solution code:
A,B,C=(map(int,input().split(' ')))
if A==B==C:
    print(-1)
    exit()
for i in range(10000):
    if A%2!=0 or B%2!=0 or C%2!=0:
        print(i)
        break
    A,B,C=B/2+C/2,A/2+C/2,A/2+B/2

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
ans = 0 
while 1:
  if {A,B,C} == {(B+C)//2,(C+A)//2,(A+B)//2}:
    print(-1)
    break
  if (A%2,B%2,C%2) == (0,0,0):
    ans += 1
    A,B,C = (B+C)//2,(C+A)//2,(A+B)//2
  else:
    print(ans)
    break

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
ans = 0 
while 1:
  if A == B == C:
    print(-1)
    break
  if (A%2,B%2,C%2) == (0,0,0):
    ans += 1
    A,B,C = (B+C)//2,(C+A)//2,(A+B)//2
  else:
    print(ans)
    break

Submission status: Wrong Answer

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

if A == B and B == C:
    print(-1)
    exit()
if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    print(0)
else:
    step = 0
    while True:
        step += 1
        nA = B // 2 + C // 2
        nB = A // 2 + C // 2
        nC = A // 2 + B // 2
        A, B, C = nA, nB, nC
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            print(step)
            break

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:
    step = 0
    while True:
        step += 1
        nA = B // 2 + C // 2
        nB = A // 2 + C // 2
        nC = A // 2 + B // 2
        A, B, C = nA, nB, nC
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            print(step)
            break

Submission status: Wrong Answer

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

if A == B and B == C:
    print(-1)
else:
    step = 0
    while True:
        step += 1
        nA = B // 2 + C // 2
        nB = A // 2 + C // 2
        nC = A // 2 + B // 2
        A, B, C = nA, nB, nC
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            print(step)
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    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:
        ans += 1
        A, B, C = (B + C) * 0.5, (A + C) * 0.5, (A + B) * 0.5
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
flag = 1
cnt = 0

if a == b and b == c:
  print("-1")
else:
  while flag:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
      a,b,c = a/2 + b/2, b/2 + c/2, c/2 + a/2
      cnt += 1
    else:
      flag = 0
  print(cnt)

Submission status: Wrong Answer

Solution code:
#13
a,b,c = map(int,input().split())
cnt = 0
if  a%2 == 1 or b%2 == 1 or c%2 == 1:
    print('0')
    
else:
    while a%2 == b%2 == c%2 == 0:
        if a==b==c:
            print('-1')
            break
        else:
            a,b,c = b//2+c//2,c//2+a//2,a//2+b//2
            cnt+=1
    print(cnt)

Submission status: Wrong Answer

Solution code:
#13
a,b,c = map(int,input().split())
cnt = 0
if  a%2 == 1 or b%2 == 1 or c%2 == 1:
    print('0')

while a%2 == b%2 == c%2 == 0:
    if a==b==c:
        print('-1')
        break
    else:
        a,b,c = b//2+c//2,c//2+a//2,a//2+b//2
        cnt+=1

print(cnt)

Submission status: Wrong Answer

Solution code:
#13
a,b,c = map(int,input().split())
cnt = 0
while a%2 == b%2 == c%2 == 0:
    if a==b==c:
        print('-1')
        break
    else:
        a,b,c = b//2+c//2,c//2+a//2,a//2+b//2
        cnt+=1
        
print(cnt)

Submission status: Wrong Answer

Solution code:
#13
a,b,c = map(int,input().split())
cnt = 0
while a%2 == b%2 == c%2 == 0:
    if a==b==c:
        print('-1')
        break
    else:
        a,b,c = b//2+c//2,c//2+a//2,a//2+b//2
        cnt+=1
        print(a,b,c)

print(cnt)

Submission status: Wrong Answer

Solution code:
cockies = list(map(int,input().split()))
inf = []
for i in range(3):
    inf.append ((cockies[i]+cockies[i-1]) % 4 > 0)
    inf.append((2*cockies[i]+cockies[i-1]+cockies[i-2]) % 8 > 0)
    inf.append((2*cockies[i]+3*cockies[i-1]+3*cockies[i-2]) % 16 > 0)
if sum(inf) == 0:
    print(inf)
    print(-1)
else:
    count = 0
    a,b,c = cockies[0], cockies[1], cockies[2]
    while count< 100:
        a,b,c = b+c, c+a, a+b
        if a%2==0 and b%2 == 0 and c%2 == 0:
             a,b,c = a//2, b//2, c//2
             count += 1
        else:
            print(count)
            break

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().rstrip().split(' '))
if(a==b and b==c):
	print(-1)
else:
	n=0
	while(a%2==0 and b%2==0 and c%2==0):
		n+=1
		tmp_a=(b+c)/2
		tmp_b=(a+c)/2
		tmp_c=(b+a)/2
		a=tmp_a
		b=tmp_b
		c=tmp_c
	print(n)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
T = [A, B, C]
T.sort()
count = 0

def trade(T, count):
    Ts = [0]*3
    if T[0] == T[1] == T[2]:
        return -1
    elif T[0]%2!= 0 or T[1]%2!= 0 or T[2]%2!= 0:
        return count
    else:
        count += 1
        T.sort()
        Ts[0] = (T[1]+T[2])/2
        Ts[1] = (T[0]+T[2])/2
        Ts[2] = (T[0]+T[1])/2
        return trade(Ts, count)

judge = trade(T, count)

print(judge)

Submission status: Wrong Answer

Solution code:
import numpy as np
cookies = np.array([int(x) for x in input().split()])

if cookies[0] == cookies[1] == cookies[2]:
  ans = -1
else:
  ans = 0
  while True:
    if not any(cookies%2):
      cookies = cookies//2
      ans += 1
      continue
    if all(cookies%2):
      ans += 1
    break
print(ans)

Submission status: Wrong Answer

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

if a == b == c:
    print(-1)
    quit()
ans = 0
a_n = 0
b_n = 0
c_n = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    a_n = (b+c)//2
    b_n = (a+c)//2
    c_n = (a+c)//2
    a = a_n
    b = b_n
    c = c_n
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
l = list(map(int,input().split()))
count = 0
if l[0] == l[1] == l[2]:
    if l[1]%2 == 0:
        print(-1)
else:
    while True:
        for i in range(3):
            if l[i]%2 == 1:
                print(count)
                exit()
        
        count += 1
        l[0],l[1],l[2] = (l[1]+l[2])//2,(l[0]+l[2])//2,(l[1]+l[0])//2

Submission status: Wrong Answer

Solution code:
l = list(map(int,input().split()))
count = 0
if l[0] == l[1] == l[2]:
    if l[1]%2 == 0:
        print(-1)
else:
    while True:
        check = True
        for i in range(3):
            if l[i]%2 == 1:
                check = False
        if check == False:
            print(count)
            exit()
        
        else:
            count += 1
            l[0],l[1],l[2] = (l[1]+l[2])//2,(l[0]+l[2])//2,(l[1]+l[0])//2

Submission status: Wrong Answer

Solution code:
l = list(map(int,input().split()))
count = 0
if l[0] == l[1] == l[2]:
    if l[1]%2 == 0:
        print(-1)
else:
    while True:
        check = True
        for i in range(3):
            if l[i]%2 == 0:
                l[i] //= 2
            else:
                check = False
        if check:
            count += 1
        
        else:
            print((count-1)*2+1)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    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:
        a_tmp = (b+c)//2
        b_tmp = (a+c)//2
        c_tmp = (c+a)//2
        a = a_tmp
        b = b_tmp
        c = c_tmp
        ans += 1

    print(ans)

Submission status: Wrong Answer

Solution code:
from fractions import gcd

if __name__ == "__main__":
    a, b, c = map(int, input().split())

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

    ab = abs(a-b)
    bc = abs(b-c)
    ca = abs(c-a)

    g = gcd(ab, bc)
    g = gcd(g, ca)

    ans = 0
    while g % 2 == 0:
        ans += 1
        g //= 2

    print(ans)

Submission status: Wrong Answer

Solution code:
from fractions import gcd

if __name__ == "__main__":
    a, b, c = map(int, input().split())

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

    ab = abs(a-b)
    bc = abs(b-c)

    g = gcd(ab, bc)

    ans = 0
    while g % 2 == 0:
        ans += 1
        g //= 2

    print(ans)

Submission status: Wrong Answer

Solution code:
i = 0

def cookie(a, b, c):
    global i
    if a == b and b == c:
        return -1
    elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        i += 1
        cookie((b+c)//2, (a+c)//2, (a+b)//2)
        return i

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

Submission status: Wrong Answer

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

flag = 0
ans = 0

if a == b == c:
  ans = -1

else:
  while flag == 0:
    if a%2 == 0 and b%2 == 0 and c%2 == 0:
      a_tmp = (b+c)/2
      b_tmp = (a+c)/2
      c_tmp = (a+b)/2
      
      a = a_tmp
      b = b_tmp
      c = c_tmp
      
      ans += 1
      
    else:
      flag = 1

print(ans)

Submission status: Wrong Answer

Solution code:
for t in range(1, 100):
  for a in range(1, 100):
    for s in range(1, 100):
      x = [t, a, s]
      count = 0
      while True:
        count += 1
        t_amari = int(x[0]) % 2
        a_amari = int(x[1]) % 2
        s_amari = int(x[2]) % 2
        if t_amari != 0:
          break
        if a_amari != 0:
          break
        if s_amari != 0:
          break
        if int(x[1])  == int(x[0])+1 and int(x[2]) == int(x[1])+1:
          break

        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
        if t_amari != 0 or a_amari != 0 or s_amari != 0:
          break
        elif t == a and a == s:
          count = -1
          break
        else:
          count = -1
          break
        # elif t == 1 or a == 1 or s == 1:
        #   count = -1
        #   break
      print(count)

Submission status: Wrong Answer

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

flag = 0
ans = 0

if a == b == c:
  ans = -1

else:
  while flag == 0:
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
      flag = 1
      
    else:
      a_tmp = (b+c)/2
      b_tmp = (a+c)/2
      c_tmp = (a+b)/2
      
      a = a_tmp
      b = b_tmp
      c = c_tmp
      
      ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
for t in range(1, 100):
  for a in range(1, 100):
    for s in range(1, 100):
      x = [t, a, s]
      count = 0
      while True:
        count += 1
        t_amari = int(x[0]) % 2
        a_amari = int(x[1]) % 2
        s_amari = int(x[2]) % 2
        if t_amari != 0:
          break
        if a_amari != 0:
          break
        if s_amari != 0:
          break
        if int(x[1])  == int(x[0])+1 and int(x[2]) == int(x[1])+1:
          break

        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
        if t_amari != 0 or a_amari != 0 or s_amari != 0:
          break
        elif t == a and a == s:
          count -= 1
          break
        else:
          count -= 1
          break
        # elif t == 1 or a == 1 or s == 1:
        #   count = -1
        #   break
      print(count)

Submission status: Wrong Answer

Solution code:
for t in range(1, 100):
  for a in range(1, 100):
    for s in range(1, 100):
      x = [t, a, s]
      count = 0
      while True:
        count += 1
        print(count)
        t_amari = int(x[0]) % 2
        a_amari = int(x[1]) % 2
        s_amari = int(x[2]) % 2
        if t_amari != 0:
          break
        if a_amari != 0:
          break
        if s_amari != 0:
          break
        if int(x[1])  == int(x[0])+1 and int(x[2]) == int(x[1])+1:
          break

        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
        if t_amari != 0 or a_amari != 0 or s_amari != 0:
          break
        elif t == a and a == s:
          count = -1
          break
        else:
          count -= 1
          break
        # elif t == 1 or a == 1 or s == 1:
        #   count = -1
        #   break

Submission status: Wrong Answer

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

a_tmp = 0
b_tmp = 0
c_tmp = 0

flag = 0
ans = 0

if a == b and b == c and c == a:
  ans = -1
else:
  while flag == 0:
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
      flag = 1
      
    else:
      a_tmp = b/2+c/2
      b_tmp = a/2+c/2
      c_tmp = a/2+b/2
      
      a = a_tmp
      b = b_tmp
      c = c_tmp
      
      ans += 1

print(ans)

Submission status: Wrong Answer

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

a_tmp = 0
b_tmp = 0
c_tmp = 0

flag = 0
ans = 0

if a == b and b == c and c == a:
  ans = -1
else:
  while flag == 0:
    b_tmp += a/2
    c_tmp += a/2
    
    a_tmp += b/2
    c_tmp += b/2
    
    a_tmp += c/2
    b_tmp += c/2
    
    a = a_tmp
    b = b_tmp
    c = c_tmp
    
    ans += 1
    
    if a%2 == 1 or b%2 ==1 or c%2 ==1:
      flag = 1
print(ans)

Submission status: Wrong Answer

Solution code:
# agc014_a.py]
A, B, C = map(int,input().split())
cnt = 0
inf = 15
for i in range(inf):
    if A%2==0 and B%2==0 and C%2==0: 
        a = (B+C)//2
        b = (A+C)//2
        c = (B+A)//2
        A = a
        B = b
        C = c
        cnt += 1
    else:
        break
if cnt == inf:
    cnt = -1
print(cnt)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
a, b, c = map(int, input().split())
if (a + b + c) % 2 != 1:
    print(-1)
else:
    cnt = 0

    while True:
        if a % 2 or b % 2 or c % 2:
            break
        cnt += 1
        a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
    print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a==b==c:
    print(-1)
else:
    p=0
    while a%2==0 and b%2==0 and c%2==0:
        aa=(b+c)//2
        bb=(c+a)//2
        cc=(b+c)//2
        a,b,c=aa,bb,cc
        p+=1
    print(p)

Submission status: Wrong Answer

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

ListA = [A]*10000
ListB = [B]*10000
ListC = [C]*10000

for i in range (1, 10000):
	ListA[i]= ListB[i-1]/2+ListC[i-1]/2
	ListB[i]= ListA[i-1]/2+ListC[i-1]/2
	ListC[i]= ListA[i-1]/2+ListB[i-1]/2
	if ListA[i]%2==1 or ListB[i]%2==1 or ListC[i]%2==1:
			print(i)
			exit()

print(-1)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,c=map(int,input().split())
    cunt=0
    while True:
        if a==b and b==c:
            print(-1)
            break
        if a%2 or b%2 or c%2:
            print(cunt)
            break
        cunt+=1
        a1,b1,c1=a,b,c
        a=(b1+c1)//2
        b=(a1+c1)//2
        c=(a1+b1)//2

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,c=map(int,input().split())
    cunt=0
    while True:
        if a==b and b==c:
            print(-1)
            break
        if a%2 or b%2 or c%2:
            print(cunt)
            break
        cunt+=1
        a1,b1,c1=a,b,c
        a=(b1+c1)//2
        b=(a1+c1)//2
        c=(a1+b1)//2
        print(a,b,c)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
flag=0
if (a==b==c):
  print(-1)
  flag=1
elif (a%2==1 or b%2==1 or c%2==1):
  print(0)
  flag=1
else:
  for i in range(1,10**9):
    a,b,c=(b//2+c//2),(a//2+c//2),(a//2+b//2)
    #print(a,b,c)
    if (a%2==1 or b%2==1 or c%2==1):
      print(i)
      flag=1
      break
if (flag==0):
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
flag=0
if (a==b==c):
  print(-1)
elif (a%2==1 or b%2==1 or c%2==1):
  print(0)
else:
  for i in range(1,10**9):
    a,b,c=(b//2+c//2),(a//2+c//2),(a//2+b//2)
    #print(a,b,c)
    if (a%2==1 or b%2==1 or c%2==1):
      print(i)
      flag=1
      break
if (flag==0):
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
flag=0
if (a==b==c):
  print(-1)
elif (a%2==1 or b%2==1 or c%2==1):
  print(0)
else:
  for i in range(1,10**9):
    a,b,c=(b//2+c//2),(a//2+c//2),(a//2+b//2)
    #print(a,b,c)
    if (a%2==1 or b%2==1 or c%2==1):
      print(i)
      flag=1
      break
if (flag==1):
  print(-1)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
cnt = 0
if A == B and B == C and C == A:
    print(-1)
else:
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        A,B,C = B//2+C//2, A//2+C//2, A//2+B//2
        cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if (a==b==c):
  print(-1)
elif (a%2==1 or b%2==1 or c%2==1):
  print(0)
else:
  for i in range(1,10**9):
    a,b,c=(b//2+c//2),(a//2+c//2),(a//2+b//2)
    #print(a,b,c)
    if (a%2==1 or b%2==1 or c%2==1):
      print(i)
      break

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
cnt=0
for i in range(100):
    if a==b==c and a%2==0:
        cnt = -1
        break
    elif a%2==0 and b%2==0 and c%2==10:
        t_a = b//2 + c//2
        t_b = a//2 + c//2
        t_c = a//2 + b//2
        a,b,c = t_a,t_b,t_c
        cnt+=1
    else:
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
cnt=0
for i in range(100):
    if a==b==c:
        cnt = -1
        break
    elif a%2==0 and b%2==0 and c%2==0:
        t_a = b//2 + c//2
        t_b = a//2 + c//2
        t_c = a//2 + b//2
        a,b,c = t_a,t_b,t_c
        cnt+=1
    else:
        break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

cnt = 0

if a == b == c and (a+b+c)%2 == 0:
    print(-1)
    exit()
else:
    while a%2 == 0 and b%2 == 0 and c%2 == 0:
        a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2
        cnt += 1
        print(a, b, c)
print(cnt)

Submission status: Wrong Answer

Solution code:
# おっぱっぴー

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

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

    print(ans)

Submission status: Wrong Answer

Solution code:
# おっぱっぴー

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

if A == B == C:
    print(-1)
else:
    for i in range(100):
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            print(i)
            break
        A, B, C = B//2+C//2, A//2+C//2, A//2+B//2

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# おっぱっぴー

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

if A == B == C:
    print(-1)
for i in range(10000):
    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(i)
        break
    A, B, C = B/2+C/2, A/2+C/2, A/2+B/2

Submission status: Wrong Answer

Solution code:
# おっぱっぴー

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

if A == B == C:
    print(-1)
for i in range(100):
    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(i)
        break
    A, B, C = B/2+C/2, A/2+C/2, A/2+B/2

Submission status: Wrong Answer

Solution code:
# おっぱっぴー

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

if A == B == C:
    print(-1)
for i in range(1000):
    A, B, C = B/2+C/2, A/2+C/2, A/2+B/2

    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(i+1)
        break

Submission status: Wrong Answer

Solution code:
# おっぱっぴー

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

if A == B == C:
    print(-1)
for i in range(100):
    A, B, C = B/2+C/2, A/2+C/2, A/2+B/2

    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(i+1)
        break

Submission status: Wrong Answer

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

if A == B == C:
    print(-1)
for i in range(10):
    A, B, C = B/2+C/2, A/2+C/2, A/2+B/2

    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(i+1)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ms = list(map(int,input().split()))
ans=0
if len(set(ms))==1 and ms[0]%2==0:
    print(-1)
else:
    while(not any([i%2==0 for i in ms])):
        l = [0]*3
        for i in range(3):
            x = ms[i]/2
            if i==0:
                l[1]+=x
                l[2]+=x
            elif i==1:
                l[0]+=x
                l[2]+=x
            elif i==2:
                l[0]+=x
                l[1]+=x
        ms = l[:]
        ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
def mapint_inp():
    return map(int, input().split())

A, B, C = mapint_inp()

print(-1)

Submission status: Wrong Answer

Solution code:
def mapint_inp():
    return map(int, input().split())

A, B, C = mapint_inp()

ans = 0
while(1):
    if A == B and B == C:
        ans = -1
        break
    if A%2==1 or B%2==1 or C%2==1:
        break
    halvedA = A//2
    halvedB = B//2
    halvedC = C//2
    A = halvedB+halvedC
    B = halvedA+halvedC
    C = halvedA+halvedB
    ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C=[int(s) for s in input().split(" ")]

A=[A]
B=[B]
C=[C]

Count=0
for i in range(1000000000):
    A.append(B[i]//2+C[i]//2)
    B.append(A[i]//2+C[i]//2)
    C.append(B[i]//2+A[i]//2)
    Count+=1
    if A[i+1]%2!=0 or B[i+1]%2!=0 or C[i+1]%2!=0:
        break
    if Count>=100000:
        Count=-1
        break

print(Count)

Submission status: Wrong Answer

Solution code:
A,B,C=[int(s) for s in input().split(" ")]

A=[A]
B=[B]
C=[C]

Count=0
for i in range(1000):
    A.append(B[i]/2+C[i]/2)
    B.append(A[i]/2+C[i]/2)
    C.append(B[i]/2+A[i]/2)
    Count+=1
    if A[i+1]%2!=0 or B[i+1]%2!=0 or C[i+1]%2!=0:
        break
    if Count>=1000:
        Count=-1

print(Count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
cnt = 0
total = a + b + c
while a % 2 == 0 or b % 2 == 0 or c % 2 == 0:
    if a == (total - a) // 2:
        cnt = -1
        break
    a = (total - a) // 2
    b = (total - b) // 2
    c = (total - c) // 2
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
cnt = 0
total = a + b + c
while True:
    if a == (total - a) // 2:
        cnt = -1
        break
    a = (total - a) // 2
    b = (total - b) // 2
    c = (total - c) // 2
    cnt += 1
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def myAnswer(A:int,B:int,C:int) ->int:
   if(A == B and B == C):
      return -1
   counter = 0
   while A%2 == 0 and B%2 == 0 and C%2 == 0:
      A, B, C = ((B//2 + C//2), (A//2 + C//2), (A//2 + B//2))
      counter += 1
   return counter

def modelAnswer():
   tmp=1
def main():
   A,B,C = map(int,input().split())
   print(myAnswer(A,B,C))

if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
l = list(map(int,input().split()))
ans = 0
if l[0] == l[1] == l[2]:
  print(-1)
  exit()
while all(i % 2 == 0 for i in l):
  a = l[0]//2; b = l[1]//2; c = l[2]//2;
  l[0] = b + c
  l[1] = a + c
  l[2] = a + b
  ans += 1
print(ans)

Submission status: Wrong Answer

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

cnt = 0
while True:
    if (A == B) & (B == C):
        print(-1)
        exit(0)
    elif (A % 2) | (B % 2) | (C % 2):
        print(cnt)
        exit(0)
    else:
        a, b, c = A // 2, B // 2, C // 2
        A, B, C = b + c, a + c, a + b
        cnt += 1
print(cnt)