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:
def main():
    A, B, C = map(int, input().split())

    ans = 0
    if (2 * A - B - C) == 0 and (2 * B - A - C) == 0 and (2 * C - A - B) == 0:
        print(-1)
    else:
        for i in range(10**8):
            if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
                print(ans)
                exit()

            A, B, C = (B + C)//2, (A + C)//2, (A + B)//2
            ans += 1

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    ans = 0
    if (2 * A - B - C) == 0 and (2 * B - A - C) == 0 and (2 * C - A - B) == 0:
        print(-1)
    else:
        for i in range(10**7):
            if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
                print(ans)
                exit()

            A, B, C = (B + C)//2, (A + C)//2, (A + B)//2
            ans += 1

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    ans = 0
    if (2 * A - B - C) == 0 and (2 * B - A - C) == 0 and (2 * C - A - B) == 0:
        print(-1)
    else:
        for i in range(10**5):
            if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
                print(ans)
                exit()

            A, B, C = (B + C)//2, (A + C)//2, (A + B)//2
            ans += 1

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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


result = 0
for i in range(10**9):
    if A % 2 == 1 or B % 2 == 1 or C // 2 == 1:
        break
    a = A // 2
    b = B // 2
    c = C // 2
    A = b + c
    B = a + c
    C = a + b
    if A == A_first and B == B_first and C == C_first:
        result = -1
        break
    result += 1   
print(result)

Submission status: Wrong Answer

Solution code:
# AtCoder Grand Contest 014
# A - Cookie Exchanges 

def f(A,B,C,n):
    if A==B==C:
        return [0,-1]
    if A%2==1 or B%2==1 or C%2==1:
        return [1,n]
    tempA=A
    tempB=B
    tempC=C
    A=tempB//2+tempC//2
    B=tempA//2+tempC//2
    C=tempA//2+tempB//2
    return [2,[A,B,C,n+1]]


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

flg = True
n=0

while flg == True:
    a=f(A,B,C,n)
    if a[0]==0:
        flg=False
        print(-1)
        exit()
    if a[0]==1:
        flg=False
        print(n)
        exit()
    if a[0]==2:
        n+=1
        A,B,C=a[1][0], a[1][1] , a[1][2]

Submission status: Wrong Answer

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

if A==B and B==C:
  ans=-1
  pass
else:
  while True:
    if A%2!=0 or B%2!=0 or C%2!=0:
      break

    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())
ans = 0
if A == B == C:
  print(-1)
else:
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    n_A = (B + C) / 2
    n_B = (A + C) / 2
    n_C = (A + B) / 2
    A = n_A
    B = n_B
    C = n_C
    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:
    n_A = (B + C) / 2
    n_B = (A + C) / 2
    n_C = (A + B) / 2
    A = n_A
    B = n_B
    C = n_C
    print(A,B,C)
    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:
    n_A = (B + C) / 2
    n_B = (A + C) / 2
    n_C = (B + C) / 2
    A = n_A
    B = n_B
    C = n_C
    ans += 1
  print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=list(map(int,input().split()))
n=0
H=[]
while True:
  S=[a,b,c]
  if S in H:
    print("-1")
    exit()
  H.append(S)
  if a%2!=0 and b%2!=0 and c%2!=0:
    print(n)
    exit()
  else:
    A=a/4
    B=b/4
    C=c/4
    a=a/2+B+C
    b=b/2+A+C
    c=c/2+A+B
    n+=1

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

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

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

ans = 0 
while True:
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
        print(ans)
        exit()
    ta = a 
    tb = b 
    tc = c 
    a = (tb+tc)//2
    b = (tc+ta)//2
    c = (ta+tb)//2
    ans += 1

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

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

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

ans = 0 
while True:
    ta = a 
    tb = b 
    tc = c 
    a = (tb+tc)//2
    b = (tc+ta)//2
    c = (ta+tb)//2
    ans += 1
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
        print(ans)
        exit()

Submission status: Wrong Answer

Solution code:
x, y, z = map(int,input().split())
a =[x]
b =[y]
c =[z]
if a[0] == b[0] == c[0]:
    if a[0] % 2 == 1:
        print(0)
        exit()
        
    else:
        print('-1')
        exit()
        
for i in range(10):
    if a[i] % 2 == 0 and b[i] % 2 == 0 and c[i] % 2 == 0:
        a.append((b[i] + c[i]) // 2)
        b.append((a[i] + c[i]) // 2)
        c.append((b[i] + a[i]) // 2)
    
    else:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
x, y, z = map(int,input().split())
a =[x]
b =[y]
c =[z]
if a[0] == b[0] == c[0]:
    print('-1')
    exit()
for i in range(10):
    if a[i] % 2 == 0 and b[i] % 2 == 0 and c[i] % 2 == 0:
        a.append((b[i] + c[i]) // 2)
        b.append((a[i] + c[i]) // 2)
        c.append((b[i] + a[i]) // 2)
    
    else:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b, c = inintm()

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

ans = 0

while a % 2 == b % 2 == c % 2 == 0:
    d = a
    e = b
    f = c
    a = e/2 + f/2
    b = d/2 + f/2
    c = d/2 + e/2
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = list(map(int, input().strip().split()))
f=0
if a==b and b==c:
    f=-1
    print(f)
else:
    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
        f=f+1
    else:
        print(f)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split(" "))
n = 0
if a == b == c:
  print(-1)
  exit()
if a % 2 == 1:
    print(0)
    exit()
if b % 2 == 1:
    print(0)
    exit()
if c % 2 == 1:
    print(0)
    exit()
for i in range(10**9):
  aa = a//2
  bb = b//2
  cc = c//2
  a = bb + cc
  b = aa + cc
  c = aa + bb
  n += 1
  if a % 2 == 1:
    break
  if b % 2 == 1:
    break
  if c % 2 == 1:
    break
print(n)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split(" "))
n = 0
if a == b == c:
  print(-1)
  exit()
for i in range(10**9):
  aa = a//2
  bb = b//2
  cc = c//2
  a = bb + cc
  b = aa + cc
  c = aa + bb
  n += 1
  if a % 2 == 1:
    break
  if b % 2 == 1:
    break
  if c % 2 == 1:
    break
print(n)

Submission status: Wrong Answer

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

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

else:
  while True:
    if A%2 == 1 or B%2 == 1 or C%2 == 1:
      break
    else:
      A2 = A
      B2 = B
      C2 = C
      A = B2/2 + C2/2
      B = A2/2 + C2/2
      C = A2/2 + B2/2
      count += 1
  print(count)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0

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

while acnt%2 == 0 and bcnt%2 == 0 and ccnt%2 == 0:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt

print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0

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

while acnt%2 != 1 and bcnt%2 != 1 and ccnt%2 != 1:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt

print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0

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

while acnt%2 != 1 and bcnt%2 != 1 and ccnt%2 != 1:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt

print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0

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

while acnt%2 != 1 and bcnt%2 != 1 and ccnt%2 != 1:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt

print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0

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

while acnt%2 != 1 and bcnt%2 != 1 and ccnt%2 != 1:
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt
    cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0

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

while acnt%2 != 1 and bcnt%2 != 1 and ccnt%2 != 1:
    acnt = b/2 + c/2
    bcnt = a/2 + c/2
    ccnt = a/2 + b/2
    a = acnt
    b = bcnt 
    c = ccnt
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

if a==b==c and a%2==0:
    print(-1)
else:
    num=0
    while True:
        if a%2==1 or b%2==1 or c%2==1:
            break
        num+=1
        l0=(b+c)/2
        l1=(c+a)/2
        l2=(a+b)/2
        a,b,c=l0,l1,l2
    else:
        print(num)

Submission status: Wrong Answer

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

if a==b==c and a%2==0:
    print(-1)
else:
    num=0
    while True:
        if a%2==1 or b%2==1 or c%2==1:
            break
        else:
            num+=1
            l0=(b+c)/2
            l1=(c+a)/2
            l2=(a+b)/2
            a,b,c=l0,l1,l2
    else:
        print(num)

Submission status: Wrong Answer

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

if a==b==c and a%2==0:
    print(-1)
else:
    num=0
    while True:
        if a%2==1 or b%2==1 or c%2==1:
            break
        else:
            l=[(b+c)/2,(c+a)/2,(a+b)/2]
            num+=1
            l=[(l[1]+l[2])/2, (l[2]+l[0])/2, (l[0]+l[2])/2]
            a=l[0]
            b=l[1]
            c=l[2]
    else:
        print(num)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,open(0).read().split())

def is_integer(x):
    tf=1
    for i in range(3):
        tf*=float.is_integer(l[i])
    return tf

if a==b==c:
    print(-1)
else:
    num=-1
    tf=1
    while tf!=0:
        l=[(b+c)/2,(c+a)/2,(a+b)/2]
        tf=is_integer(l)
        num+=1
        l=[(l[1]+l[2])/2, (l[2]+l[0])/2, (l[0]+l[2])/2]
    else:
        print(num)

Submission status: Wrong Answer

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

if A == B == C:
  res = -1
else:
  while all([A % 2 ==0, B % 2 == 0, C % 2 ==0]):
    at, bt, ct = A/2, B/2, C/2
    A = bt + ct
    B = at + ct
    C = at + bt
    res += 1

print(res)

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 True:
        if A%2==1 or B%2==1 or C%2==1:
            break
        a = B/2 + C/2
        b = A/2 + C/2
        c = A/2 + B/2
        A, B, C = a, b, c
        ans += 1
    print(ans)

Submission status: Wrong Answer

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

diff1 = abs(A-B)
diff2 = abs(B-C)

if diff1 == 0 and diff2 == 0:
    print(-1)
    exit()

ans = 0
while diff1 % 2 == 0 and diff2 % 2 == 0:
    ans += 1
    diff1 //= 2
    diff2 //= 2

print(ans)

Submission status: Wrong Answer

Solution code:
x,y,z = map(int,input().split())

ans = 0

s = []

while True:
    x,y,z = y//2+z//2,x//2+z//2,x//2+y//2
    if x%2 == 0 and y%2 == 0 and z%2 == 0:
        ans += 1
        if [x,y,z] in s:
            print(-1)
            break
        else:
            s.append([x,y,z])
    else:
        print(ans+1)
        break

Submission status: Wrong Answer

Solution code:
x,y,z = map(int,input().split())

ans = 0

s = []

while True:
    x,y,z = y//2+z//2,x//2+z//2,x//2+y//2
    if x%2 == 0 and y%2 == 0 and z%2 == 0:
        ans += 1
        if [x,y,z] in s:
            print(-1)
            break
        else:
            s.append([x,y,z])
    else:
        print(ans+1)
        break
    if tuple([x,y,z]) in s:
        print(-1)
        break

Submission status: Wrong Answer

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

k = 0
while True:
    if A==B==C:
        k = -1
        break
    k += 1
    An = (B + C)//2
    Bn = (A + C)//2
    Cn = (B + A)//2
    A = An 
    B = Bn 
    C = Cn     
    if A%2==1 or B%2==1 or C%2==1 or min([A,B,C])<1:
        break

print(k)

Submission status: Wrong Answer

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

k = 0
while True:
    if A==B==C:
        k = -1
        break
    k += 1
    An = (B + C)//2
    Bn = (A + C)//2
    Cn = (B + A)//2
    A = An 
    B = Bn 
    C = Cn     
    print(A,B,C)
    if A%2==1 or B%2==1 or C%2==1 or min([A,B,C])<1:
        break

print(k)

Submission status: Wrong Answer

Solution code:
a, b, c = [int(i) for i in input().split()]

cnt = 0
history = set()
while True:
  print(a, b, c, "-", cnt, history)
  if (a, b, c) in history:
    print(-1)
    exit(0)
  if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print(cnt)
    exit(0)
  a, b, c = sorted([a, b, c])
  history.add((a, b, c))
  na = b // 2 + c // 2
  nb = a // 2 + c // 2
  nc = a // 2 + b // 2
  a = na
  b = nb 
  c = nc
  cnt += 1

Submission status: Wrong Answer

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

count = 0

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

while 1:
    if A%2==0 and B%2==0 and C%2==0:
        A_tmp = B//2 + C//2
        B_tmp = A//2 + C//2
        C_tmp = A//2 + B//2
        A, B, C = A_tmp, B_tmp, C_tmp
        count += 1
    else:
        break
print(count)

Submission status: Wrong Answer

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

x = 0
y = 0
z = 0

while a%2 == 0:
  x += 1
while b%2 == 0:
  y += 1
while c%2 == 0:
  z += 1
  
if a == b == c:
  print(-1)
else:
  print(min(a,b,c))

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a==b==c:
  print(-1)
  exit()
cnt=0
while all([q%2==0 for q in (a,b,c)]):
  cnt+=1
  s=a+b+c
  a=s-a
  a//=2
  b=s-b
  b//=2
  c=s-c
  c//=2
print(cnt)

Submission status: Wrong Answer

Solution code:
T,A,S = map(int, input().split(' '))

persons = [T, A, S]

def check_even(persons):
    for person in persons:
        if person % 2 != 0:
            return False
    return True


# 全数同値 -> 無限
if T == A and A == S:
    print(-1)
    exit()

# 0回目
if not check_even(persons):
    print(0)
    exit()

count = 1

while True:
    for person in persons:
        tmp_0 = persons[0]
        tmp_1 = persons[1]
        tmp_2 = persons[2]

        persons[0] = 0 + tmp_1 / 2 + tmp_2 / 2
        persons[1] = tmp_0 / 2 + 0 + tmp_2 / 2
        persons[2] = tmp_0 / 2 + tmp_1 / 2 + 0

        if check_even(persons):
            count += 1
        else:
            print(count)
            exit()

Submission status: Wrong Answer

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

if A == 1 and B == 1 and C == 1:
    print(0)

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

LA = []
LB = []
LC = []
LA.append(A)
LB.append(B)
LC.append(C)
i = 0
cnt = 0

while LA[i] % 2 == 0 and LB[i] % 2 == 0 and LC[i] % 2 == 0:
    LA.append((LB[i]+LC[i])/2)
    LB.append((LC[i]+LA[i])/2)
    LC.append((LA[i]+LB[i])/2)
    i += 1
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

if A == B == C == 1:
    print(0)

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

LA = []
LB = []
LC = []
LA.append(A)
LB.append(B)
LC.append(C)
i = 0
cnt = 0

while LA[i] % 2 == 0 and LB[i] % 2 == 0 and LC[i] % 2 == 0:
    LA.append((LB[i]+LC[i])/2)
    LB.append((LC[i]+LA[i])/2)
    LC.append((LA[i]+LB[i])/2)
    i += 1
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

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

LA = []
LB = []
LC = []
LA.append(A)
LB.append(B)
LC.append(C)
i = 0
cnt = 0

while LA[i] % 2 == 0 and LB[i] % 2 == 0 and LC[i] % 2 == 0:
    LA.append((LB[i]+LC[i])/2)
    LB.append((LC[i]+LA[i])/2)
    LC.append((LA[i]+LB[i])/2)
    i += 1
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

Flag = True
count = 0
while Flag:
    if A == B == C:
        Flag = False
        count = -1
        continue
    if A % 2 ==1 or B % 2==1 or C % 2 ==1:
        Flag = False
        continue
    A_ = B // 2 + C //2
    B_ = A // 2 + C //2
    C_ = A // 2 + B //2
    A,B,C = A_,B_,C_
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
a_tmp = a ; b_tmp = b ; c_tmp = c
count = 0
while True :
    if a == b == c :
        print("-1")
        break
    elif a%2 == 1 or b%2 == 1 or c%2 == 1 :
        print(count)
        break
    else :
        a = b_tmp/2 + c_tmp/2
        b = a_tmp/2 + c_tmp/2
        c = a_tmp/2 + b_tmp/2
        a_tmp = a ; b_tmp = b ; c_tmp = c
        count += 1

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
a_tmp = a ; b_tmp = b ; c_tmp = c
count = 0
while True :
    count += 1
    a = b_tmp/2 + c_tmp/2
    b = a_tmp/2 + c_tmp/2
    c = a_tmp/2 + b_tmp/2
    if a == a_tmp and b == b_tmp and c == c_tmp :
        print("-1")
        break
    a_tmp = a ; b_tmp = b ; c_tmp = c
    if a%2 == 1 or b%2 == 1 or c%2 == 1 :
        print(count)
        break
    else :
        continue

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
a_tmp = a ; b_tmp = b ; c_tmp = c
count = 0
while True :
    count += 1
    a = b_tmp/2 + c_tmp/2
    b = a_tmp/2 + c_tmp/2
    c = a_tmp/2 + b_tmp/2
    a_tmp = a ; b_tmp = b ; c_tmp = c
    if a%2 == 1 or b%2 == 1 or c%2 == 1 :
        print(count)
        break
    elif count > 10000000 :
        print("-1")
        break
    else :
        continue

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
a_tmp = a ; b_tmp = b ; c_tmp = c
count = 0
while True :
    count += 1
    a = b_tmp/2 + c_tmp/2
    b = a_tmp/2 + c_tmp/2
    c = a_tmp/2 + b_tmp/2
    a_tmp = a ; b_tmp = b ; c_tmp = c
    if a%2 == 1 or b%2 == 1 or c%2 == 1 :
        print(count)
        break
    elif count > 100000 :
        print("-1")
        break
    else :
        continue

Submission status: Wrong Answer

Solution code:
import sys
a,b,c = map(int,input().split(" "))
li = [[a,b,c]]
if (a % 2)==1 or (b % 2)==1 or (c % 2)==1:
  print(0)
count=0

for i in range(100):
  a2 = a/2
  b2 = b/2
  c2 = c/2
  a = b2+c2
  b = c2+a2
  c = a2+b2  
  count += 1
  if (a % 2)==1 or (b % 2)==1 or (c % 2)==1:
    break
  elif [a,b,c] in li:
    print(-1)
    sys.exit()
  else:
    li.append([a,b,c])
    
print(count)

Submission status: Wrong Answer

Solution code:
import sys
a,b,c = map(int,input().split(" "))
li = [[a,b,c]]
count = 0
for i in range(100):
  a2 = a/2
  b2 = b/2
  c2 = c/2
  a = b2+c2
  b = c2+a2
  c = a2+b2  
  count += 1
  if (a % 2)==1 or (b % 2)==1 or (c % 2)==1:
    break
  elif [a,b,c] in li:
    print(-1)
    sys.exit()
  else:
    li.append([a,b,c])
    
print(count)

Submission status: Wrong Answer

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

import numpy as np
a = np.array(ri_())
ans = 0
while True:
    if a[0] == a[1] and a[1] == a[2]:
        ans = -1
        break
    if np.any(a % 2 == 1):
        break
    a = (sum(a) - a) // 2
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

import numpy as np
a = np.array(ri_())
ans = 0
while True:
    if a[0] == a[1] and a[1] == a[2]:
        ans = -1
        break
    ans += 1
    a = (sum(a) - a) // 2
    if np.any(a % 2 == 1):
        break
print(ans)

Submission status: Wrong Answer

Solution code:
def solve(A):
    r = []
    for n in A:
        if n < 2:
            r.append(0)
            continue
        cnt = 0
        while n % 2 == 0:
            n //= 2
            cnt += 1
        r.append(cnt)
    return r


def resolve():
    A = [int(i) for i in input().split()]
    if min(A) == max(A):
        print(-1)
    else:
        s = solve(A)
        if min(s) == 0 or min(s) != max(s):
            print(min(s))
        else:
            print(min(s) + 1)


resolve()

Submission status: Wrong Answer

Solution code:
def solve(A):
    r = []
    for n in A:
        if n < 2:
            return n
        cnt = 0
        while n % 2 == 0:
            n //= 2
            cnt += 1
        r.append(cnt)
    return r


def resolve():
    A = [int(i) for i in input().split()]
    if min(A) == max(A):
        print(-1)
    else:
        s = solve(A)
        if min(s) == 0 or min(s) != max(s):
            print(min(s))
        else:
            print(min(s) + 1)


resolve()

Submission status: Wrong Answer

Solution code:
def solve(A):
    r = []
    for n in A:
        if n < 2:
            return n
        cnt = 0
        while n % 2 == 0:
            n //= 2
            cnt += 1
        r.append(cnt)
    return r


def resolve():
    A = [int(i) for i in input().split()]
    if min(A) == max(A):
        print(-1)
    else:
        s = solve(A)
        if min(s) != max(s):
            print(min(s))
        else:
            print(min(s) + 1)


resolve()

Submission status: Wrong Answer

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

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

while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    al = b // 2 + c // 2
    bl = a // 2 + c // 2
    cl = a // 2 + b // 2
    a = al
    b = bl
    c = cl
    i += 1

print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and i < 10 ** 5:
    x = a // 2
    y = b // 2
    z = c // 2
    a = a // 2
    b = b // 2
    c = c // 2
    a += y // 2 + z // 2
    b += x // 2 + z // 2
    c += x // 2 + y // 2
    i += 1

if i < 10 ** 5:
    print(i)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


l = list(map(int, input().split()))
l.sort()
a,b,c = l
ans = 0
while True:
    if a==b==c:
        ans = -1
        break
    if a%2 or b%2 or c%2:
        break
    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:
import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy


def odd(n): return n & 1


def even(n): return not odd(n)

S = input()
dump(S)
print(S)

Submission status: Wrong Answer

Solution code:
def exchange(l):
    newlist = [0,0,0]
    for i in range(3):
        for j in range(3):
            if i!=j:
                newlist[i]+=l[j]//2
    return newlist

def containsOdd(l):
    for i in range(3):
        if l[i]%2 == 1:
            return True
    return False

def isAllEquals(l):
    if l[0] == l[1] == l[2]:
        return True
    return False

def main():
    cookies = [int(x) for x in input().split()]
    ans = 0
    while True:
        if isAllEquals(cookies):
            print(-1)
            return 0
        if containsOdd(cookies):
            print(ans)
            return 0
        cookies = exchange(cookies)
        ans += 1

if __name__ == '__main__':
    main()

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 == 0 and B%2 == 0 and 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:
def exchange(l):
    newlist = [0,0,0]
    for i in range(3):
        for j in range(3):
            if i!=j:
                newlist[i]+=l[j]//2

    return newlist

def containsOdd(l):
    for i in range(3):
        if l[i]%2 == 1:
            return True
    return False

def isAllEquals(l):
    if l[0] == l[1] == l[2]:
        return True

    return False

def main():
    cookies = [int(x) for x in input().split()]
    ans = 0
    while True:
        if isAllEquals(cookies):
            print(-1)
            return 0
        if containsOdd(cookies):
            print(ans)
            return 0
        cookies = exchange(cookies)
        ans += 1

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if A == B == C:
    if A % 2 == 0:
        print('-1')
else:
    count = 0
    for _ in range(10 ** 9):
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            print(count)
            break
        tmp_A = A
        tmp_B = B
        tmp_C = C
        A = (tmp_B + tmp_C) / 2
        B = (tmp_A + tmp_C) / 2
        C = (tmp_B + tmp_A) / 2
        count += 1

Submission status: Wrong Answer

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

if A == B == C:
    print('-1')
else:
    count = 0
    for _ in range(10 ** 9):
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            print(count)
            break
        tmp_A = A
        tmp_B = B
        tmp_C = C
        A = (tmp_B + tmp_C) / 2
        B = (tmp_A + tmp_C) / 2
        C = (tmp_B + tmp_A) / 2
        count += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    a=tuple(map(int,input().split()))
    e=set()
    count = 0
    while a not in e:
        e.add(a)
        count += 1
        a=((a[1]+a[2])//2,(a[0]+a[2])//2,(a[0]+a[1])//2)
        for x in a:
            if x % 2 != 0:
                print(count)
                return
    else:
        print(-1)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split());e=a-b|c-b;print((e&-e).bit_length()-1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|c-b
print(len(bin(e&-e))-3or~b%-2)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|c-b
print(len(bin(e&-e))-3or~a%-2)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a == b == c:
   print(-1)
   exit()

cnt = 0
while True:
   if a % 2 or b % 2 or c % 2:
      break
   cnt += 1
   next_a = b // 2 + c // 2
   next_b = a // 2 + c // 2
   next_c = a // 2 + b // 2
   a = next_a; b = next_b; c = next_c
print(cnt)

Submission status: Wrong Answer

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

if A == B and B == C: 
  print(-1)
else:
  c = 0
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    ba = A
    bb = B
    bc = C
    A = (bb + bc)//2
    B = (ba + bc)//2
    C = (ba + bb)//2
    c+=1
  print(c)

Submission status: Wrong Answer

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

if A == B == C: 
  print(-1)
else:
  c = 0
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    ba = A
    bb = B
    bc = C
    A = (bb + bc)//2
    B = (ba + bc)//2
    C = (ba + bb)//2
    c+=1
  print(c)

Submission status: Wrong Answer

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

if A == B == C or (C+B == 2*A and A+B == 2*C and A+C == 2*B): 
  print(-1)
else:
  c = 0
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    ba = A
    bb = B
    bc = C
    A = bb//2 + bc//2
    B = ba//2 + bc//2
    C = ba//2 + bb//2
    c+=1
  print(c)

Submission status: Wrong Answer

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

if A == B == C:
  print(-1)
else:
  c = 0
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    ba = A
    bb = B
    bc = C
    A = bb//2 + bc//2
    B = ba//2 + bc//2
    C = ba//2 + bb//2
    c+=1
  print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print(len(f'{e&-e:b}')-(e!=b&1))

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
e=a-b|b-c
print(len(f'{e&-e:b}')-(e==b&1))