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


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b, c = list(map(int, readline().split()))
    if a == b == c:
        print(-1)
    else:
        cnt = 0
        while True:
            if a % 2 == b % 2 == c % 2 == 0:
                cnt += 1
                a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
            else:
                print(cnt)
                exit()


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:

import sys

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


for i in range(1000000):

    na = A
    nb = B
    nc = C

    A = (nb+nc) // 2
    B = (na+nc) // 2
    C = (na+nb) // 2

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        print (i+1)
        sys.exit()

print (-1)

Submission status: Wrong Answer

Solution code:

import sys

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


for i in range(100000):

    na = A
    nb = B
    nc = C

    A = (nb+nc) // 2
    B = (na+nc) // 2
    C = (na+nb) // 2

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        print (i+1)
        sys.exit()

print (-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
cnt = 0
while cnt <= 100:
    
    a,b,c = (b+c)/2, (a+c)/2,(a+b)/2
    cnt += 1
    if any((a%1!=0,b%1!=0,c%1!=0)):
        print(cnt-1)
        exit()
print(-1)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
cnt=1
while True:
 aa=a
 bb=b
 cc=c
 a=(bb+cc)/2
 b=(cc+aa)/2
 c=(aa+bb)/2
 if a%2==1 or b%2==1 or c%2==1:
  print(cnt)
  exit()
 elif a==b==c:
  print(-1)
  exit()
 else:
  cnt+=1

Submission status: Wrong Answer

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

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

ans = 0
while True:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        ans += 1
        a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
    else:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ans=0
for i in range(10):
  if a%2>0 or b%2>0 or c%2>0:
    break
  if a==b and b==c:
    ans=-1
    break
  a,b,c=b//2+c//2,c//2+a//2,a//2+b//2
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ans=0
for i in range(10):
  m=min(a,b,c)
  a-=m
  b-=m
  c-=m
  if a%2>0 or b%2>0 or c%2>0:
    break
  if a==0 and b==0 and c==0:
    ans=-1
    break
  a,b,c=b//2+c//2,c//2+a//2,a//2+b//2
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

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

count = 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
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
def examA():
    A, B, C = LI()
    S = A+B+C
    cur = 0
    for i in range(32):
        A = (S-A)//2
        B = (S-B)//2
        C = (S-C)//2
        cur +=1
        if A%2==1 or B%2==1 or C%2==1:
            break
    if cur==32:
        ans = -1
    else:
        ans = cur
    print(ans)

import sys,copy,bisect,itertools,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a == b == c:
  print("-1")
else:
  ans = 0
  while True:
    if a%2 or b%2 or c%2:
      print(ans)
      break
    at, bt, ct = a, b, c
    a = bt//2 + ct//2
    b = ct//2 + at//2
    c = at//2 + bt//2
    ans += 1

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 or b%2 or c%2) == 0 :
    tmp1 = a
    tmp2 = b
    a = b/2 + c/2
    b = tmp1/2 + c/2
    c = tmp1/2 + tmp2/2
    ans += 1
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a = inpl()
if a[0] == a[1] == a[2]:
    print(-1)
else:
    cnt = 0
    while True:
        for i in a:
            if i%2:
                print(cnt)
                quit()
        b = [0] * 3
        b[0] = (a[1] + a[2]) // 2
        b[1] = (a[0] + a[2]) // 2
        b[2] = (a[1] + a[0]) // 2

        cnt += 1
        a[::] = b[::]

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(10**5):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-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 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(10**9):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-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 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(200000):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-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:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(200000):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-1
    print(ans)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=[a[0],a[1],a[2]]
c=[0,0,0]
mb=True
i=0
cnt=0
if a[0]==a[1]==a[2]:
    if a[0]%2==1:
        print(0)
        exit()
    print(-1)
    exit()

while mb:
    if i==0:
        c[1]+=b[0]//2
        c[2]+=b[0]//2
        c[0]+=b[1]//2
        c[2]+=b[1]//2
        c[1]+=b[2]//2
        c[0]+=b[2]//2
        cnt+=1
        i=1
        b=[0,0,0]
        if c[0]%2==1 or c[1]%2==1 or c[2]%2==1:
            mb=False
    else:
        b[1]+=c[0]//2
        b[2]+=c[0]//2
        b[0]+=c[1]//2
        b[2]+=c[1]//2
        b[1]+=c[2]//2
        b[0]+=c[2]//2
        c=[0,0,0]
        i=0
        cnt+=1
        if b[0]%2==1 or b[1]%2==1 or b[2]%2==1:
            mb=False
    if a==b or a==c:
        break
if mb:
    print(-1)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=[a[0],a[1],a[2]]
c=[0,0,0]
mb=True
i=0
cnt=0
if a[0]==a[1]==a[2]:
    print(-1)
    exit
if a[0]%2==1 or a[1]%2==1 or a[2]%2==1:
    print(0)
    exit()
while mb:
    if i==0:
        c[1]+=b[0]//2
        c[2]+=b[0]//2
        c[0]+=b[1]//2
        c[2]+=b[1]//2
        c[1]+=b[2]//2
        c[0]+=b[2]//2
        cnt+=1
        i=1
        b=[0,0,0]
        if c[0]%2==1 or c[1]%2==1 or c[2]%2==1:
            mb=False
    else:
        b[1]+=c[0]//2
        b[2]+=c[0]//2
        b[0]+=c[1]//2
        b[2]+=c[1]//2
        b[1]+=c[2]//2
        b[0]+=c[2]//2
        c=[0,0,0]
        i=0
        cnt+=1
        if b[0]%2==1 or b[1]%2==1 or b[2]%2==1:
            mb=False
    if a==b or a==c:
        break
if mb:
    print(-1)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=[a[0],a[1],a[2]]
c=[0,0,0]
mb=True
i=0
cnt=0
if a[0]==a[1]==a[2]:
    print(-1)
    exit()
while mb:
    if i==0:
        c[1]+=b[0]//2
        c[2]+=b[0]//2
        c[0]+=b[1]//2
        c[2]+=b[1]//2
        c[1]+=b[2]//2
        c[0]+=b[2]//2
        cnt+=1
        i=1
        b=[0,0,0]
        if c[0]%2==1 or c[1]%2==1 or c[2]%2==1:
            mb=False
    else:
        b[1]+=c[0]//2
        b[2]+=c[0]//2
        b[0]+=c[1]//2
        b[2]+=c[1]//2
        b[1]+=c[2]//2
        b[0]+=c[2]//2
        c=[0,0,0]
        i=0
        cnt+=1
        if b[0]%2==1 or b[1]%2==1 or b[2]%2==1:
            mb=False
    if a==b or a==c:
        break
if mb:
    print(-1)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c= list(map(int,input().split()))
ans=1
if a==b==c:
    if a%2==0:
        print(-1)
    else:
        print(0)

else:
    for i in range(10**9+1):
        x=a
        y=b
        z=c
        a=(y+z)//2
        b=(x+z)//2
        c=(x+y)//2
        if a%2==1 or b%2==1 or c%2==1:
            print(i+1)
            ans*=0
            break
if ans==1:
    print(-1)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=[a[0],a[1],a[2]]
c=[0,0,0]
mb=True
i=0
cnt=0
while mb:
    if i==0:
        # c[0]=b[0]/2
        # c[1]=b[1]/2
        # c[2]=b[2]/2
        c[1]+=b[0]//2
        c[2]+=b[0]//2
        c[0]+=b[1]//2
        c[2]+=b[1]//2
        c[1]+=b[2]//2
        c[0]+=b[2]//2
        cnt+=1
        i=1
        b=[0,0,0]
        if c[0]%2==1 or c[1]%2==1 or c[2]%2==1:
            mb=False
    else:
        # b[0]=c[0]/2
        # b[1]=c[1]/2
        # b[2]=c[2]/2
        b[1]+=c[0]//2
        b[2]+=c[0]//2
        b[0]+=c[1]//2
        b[2]+=c[1]//2
        b[1]+=c[2]//2
        b[0]+=c[2]//2
        c=[0,0,0]
        i=0
        cnt+=1
        if b[0]%2==1 or b[1]%2==1 or b[2]%2==1:
            mb=False
    if a==b or a==c:
        break
if mb:
    print(-1)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c= list(map(int,input().split()))
ans=1
if a==b==c:
    if a%2==0:
        print(-1)
    else:
        print(0)

else:
    for i in range(10**9+1):
        x=a
        y=b
        z=c
        a=(y+z)//2
        b=(x+z)//2
        c=(x+y)//2
        if a%2==1 or b%2==1 or c%2==1:
            print(i+1)
            break
    print(-1)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=[a[0],a[1],a[2]]
c=[0,0,0]
mb=True
i=0
cnt=0
while mb:
    if i==0:
        c[0]=b[0]/2
        c[1]=b[1]/2
        c[2]=b[2]/2
        c[1]=b[0]/4
        c[2]=b[0]/4
        c[0]=b[1]/4
        c[2]=b[1]/4
        c[1]=b[2]/4
        c[0]=b[2]/4
        cnt+=1
        i=1
        if c[0]%2==1 or c[1]%2==1 or c[2]%2==1:
            mb=False
    else:
        b[0]=c[0]/2
        b[1]=c[1]/2
        b[2]=c[2]/2
        b[1]=c[0]/4
        b[2]=c[0]/4
        b[0]=c[1]/4
        b[2]=c[1]/4
        b[1]=c[2]/4
        b[0]=c[2]/4
        i=0
        cnt+=1
        if b[0]%2==1 or b[1]%2==1 or b[2]%2==1:
            mb=False
    if a==b or a==c:
        break
if mb:
    print(-1)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c= list(map(int,input().split()))
ans=1
if a==b==c:
    if a%2==0:
        print(-1)
    else:
        print(0)

else:
    for i in range(10**9+1):
        x=a
        y=b
        z=c
        a=(y+z)//2
        b=(x+z)//2
        c=(x+y)//2
        if a%2==1 or b%2==1 or c%2==1:
            print(i+1)
            break
print(-1)

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:
        print(0)

else:
    for i in range(10**9+1):
        x=a
        y=b
        z=c
        a=(y+z)//2
        b=(x+z)//2
        c=(x+y)//2
        if a%2==1 or b%2==1 or c%2==1:
            print(i+1)
            break

Submission status: Wrong Answer

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

ans = 1
if A == B == C:
    print(-1)
    exit()
else:
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        print(0)
        exit()
    while 1:
        a = B // 2 + C // 2
        b = C // 2 + A // 2
        c = A // 2 + B // 2
        ##print(a, b, c)
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            A = a
            B = b
            C = c
            ans += 1
        else:
            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
while a%2 == 0 and b%2 == 0 and c%2 == 0:
    a, b, c = int(b/2)+int(c/2), int(a/2)+int(c/2), int(a/2)+int(b/2)
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
import sys
if a%2+b%2+c%2>0:
    print(0)
    sys.exit()
e=0

while e<10000:
    a,b,c=b//2+c//2,a//2+c//2,a//2+b//2
    e+=1
    print(a,b,c)
    if a%2+b%2+c%2>0:
        break

if e==10000:
    print(-1)
else:
    print(e)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

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

ans = 0
T = A + B + C
s = np.array([A, B, C])
while all(s % 2 == 0):
    s = (T - s) // 2
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a==b==c:
    print(-1)
    exit()
v=[a,b,c]
v.sort()
tmp=[b-a,c-a,c-b]
ans=10**10
for i in range(len(tmp)):
    cnt=0
    while(tmp[i]%2==0):
        tmp[i]=tmp[i]//2
        cnt+=1
    ans=min(ans,cnt)

print(ans)

Submission status: Wrong Answer

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

result = 0

while(True):
  A = (b + c) / 2
  B = (c + a) / 2
  C = (a + b) / 2
  if((b - a) % 2 > 0 or (c - b) % 2 > 0 or (a - c) % 2 > 0):
    print(result)
    break
  a, b, c = A, B, C
  result += 1

Submission status: Wrong Answer

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

ans = 0
flag = False
while True:
    if a == b == c and a % 2 == 0:
        flag = True
        break
    elif a % 2 == b % 2 == c % 2 == 0:
        a = b//2 + c//2
        b = c//2 + a//2
        c = a//2 + b//2
        ans += 1
    else:
        break

if flag:
    print(-1)
else:
    print(ans)

Submission status: Wrong Answer

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

if l.count(l[0])==3:
    print(-1)
    exit()

count=0
while True:
    temp=list(map(lambda x:x%2,l))
    all=sum(temp)
    if all==3:
        print(count+1)
        exit()
    elif all==2:
        print(count)
        exit()
    elif all==1:
        print(count)
        exit()
    l=list(map(lambda x:x//2,l))
    count+=1

Submission status: Wrong Answer

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

if l.count(l[0])==3:
    print(-1)
    exit()

count=0
while True:
    temp=list(map(lambda x:x%2,l))
    all=sum(temp)
    if all==3:
        print(count+1)
        exit()
    elif all==2:
        print(count)
        exit()
    elif all==1:
        print(count)
        exit()
    l=list(map(lambda x:x//2,l))
    count+=1
    print(l)

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 == 0 and b % 2 == 0 and c % 2 == 0:
            ans += 1
            A = b / 2 + c / 2
            B = c / 2 + a / 2
            C = a / 2 + b / 2
            a = A
            b = B
            c = C
        else:
            break
    print(ans)

Submission status: Wrong Answer

Solution code:
from math import log2
a,b,c = map(int,input().split())
if a == b and b == c:
    print(-1)
else:
    ans = 1
    while True:
        A = b/2 + c/2
        B = a/2 + c/2
        C = a/2 + b/2
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            break
        else:
            ans += 1
            a = A
            b = B
            c = C
    print(ans)

Submission status: Wrong Answer

Solution code:
from math import log2
a,b,c = map(int,input().split())
if a == b == c:
    print(-1)
else:
    ans = 1
    while True:
        A = b/2 + c/2
        B = a/2 + c/2
        C = a/2 + b/2
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            break
        else:
            ans += 1
            a = A
            b = B
            c = C
    print(ans)

Submission status: Wrong Answer

Solution code:
from math import log2
a,b,c = map(int,input().split())
if a == b == c:
    print(-1)
else:
    print(int(log2(max(a,b,c))))

Submission status: Wrong Answer

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

def aa():
    if a == b and a == c:
        return -1
    else:
        A = [a-b, b-c, c-a]
        j = 0
        while True:
            for i in range(3):
                if A[i] % 2 == 1:
                    return j
                else:
                    A[i] //= 2
            j += 1

print(aa())

Submission status: Wrong Answer

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

for i in range(10000):
    if a == b and b == c:
        n -= 1
        break
    elif a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    else:
        a , b , c = (b + c) / 2 , (c + a) / 2 , (a + b) / 2
        n += 1
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break

print(n)

Submission status: Wrong Answer

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

if A == B == C:
    print(-1)
else:
    while A % 2 == B % 2 == 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 change(a,b,c):
    a1=b//2+c//2
    b1=a//2+c//2
    c1=a//2+b//2
    return a1,b1,c1
a,b,c = map(int,input().split())
if a==b and b==c:
    print(-1)
    exit()
cnt=0
while a%2==0 and b%2==0 and c%2==0:
    a,b,c=change(a,b,c)
    cnt+=1
    if a==b and b==c and a%2==0:
        print(-1)
        exit()
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a, b, c = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    if a == b == c:
        print(-1)
    else:
        while True:
            if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
                a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
                cnt += 1
            else:
                print(cnt)
                exit()


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

Solution code:
import math


def resolve():
    a, b, c = map(int, input().split())
    cnt = 0
    if a == b == c:
        if a % 2:
            print(0)
        else:
            print(-1)
        return 0
    for _ in range(int(math.log2(10 ** 9)) + 1):
        a_new, b_new, c_new = (b + c) // 2, (a + c) // 2, (a + b) // 2,
        a, b, c = a_new, b_new, c_new
        cnt += 1
        if any(i % 2 for i in [a_new, b_new, c_new]):
            print(cnt)
            return 0
    print(-1)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math


def resolve():
    a, b, c = map(int, input().split())
    cnt = 0
    if a == b == c:
        if a % 2:
            print(0)
        else:
            print(-1)
        return 0
    for _ in range(int(math.log2(10 ** 9))):
        a_new, b_new, c_new = (b + c) // 2, (a + c) // 2, (a + b) // 2,
        a, b, c = a_new, b_new, c_new
        cnt += 1
        if any(i % 2 for i in [a_new, b_new, c_new]):
            print(cnt)
            return 0
    print(-1)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math


def resolve():
    a, b, c = map(int, input().split())
    cnt = 0
    if a == b == c:
        print(-1)
        return 0
    for _ in range(int(math.log2(10 ** 9))):
        a_new, b_new, c_new = (b + c) // 2, (a + c) // 2, (a + b) // 2,
        a, b, c = a_new, b_new, c_new
        cnt += 1
        if any(i % 2 for i in [a_new, b_new, c_new]):
            print(cnt)
            return 0
    print(-1)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math


def resolve():
    a, b, c = map(int, input().split())
    cnt = 0
    for _ in range(int(math.log2(10 ** 9))):
        a_new, b_new, c_new = (b + c) // 2, (a + c) // 2, (a + b) // 2,
        a, b, c = a_new, b_new, c_new
        cnt += 1
        if any(i % 2 for i in [a_new, b_new, c_new]):
            print(cnt)
            return 0
    print(-1)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c = map(int, input().split())
    cnt = 0
    for _ in range(10 ** 5):
        a_new, b_new, c_new = (b + c) // 2, (a + c) // 2, (a + b) // 2,
        a, b, c = a_new, b_new, c_new
        cnt += 1
        if any(i % 2 for i in [a_new, b_new, c_new]):
            print(cnt)
            return 0
    print(-1)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
k=0
#無限を除く
if len(set(a))==1:
	print(-1)
else:
	while a[0]%2==0 and a[1]%2==0 and a[2]%2==0:
		a[0],a[1],a[2]=int((a[1]+a[2])/2),int((a[0]+a[2])/2),int((a[1]+a[0])/2)
    #print(a)
		k+=1
	print(k)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
k=0
#無限を除く
if len(set(a))==1:
	print(-1)
else:
	while a[0]%2==0 and a[1]%2==0 and a[2]%2==0:
		a[0],a[1],a[2]=int((a[1]+a[2])/2),int((a[0]+a[2])/2),int((a[1]+a[0])/2)
    #print(a)
		k+=1
print(k)

Submission status: Wrong Answer

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

for i in range(10 ** 9):
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(i)
        exit()
    a, b, c = (b + c) // 2, (c + a) // 2, (a + 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(10 ** 9):
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(i)
        exit()
    a, b, c = b // 2 + c // 2, c // 2 + a // 2, a // 2 + b // 2

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt=0
t=[]
while True:
	cnt+=1
	a,b,c=b//2+c//2, a//2+c//2, a//2+b/2
	if [a,b,c] not in t:t.append([a,b,c])
	else:
		print(-1)
		break
	if a%2!=0 or b%2!=0 or c%2!=0:
		print(cnt)
		break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a, b, c = list(map(int, input().rstrip('\n').split()))
    if a == b == c:
        if a & 2 == 0:
            print(-1)
        else:
            print(0)
    else:
        cnt = 0
        while True:
            if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
                cnt += 1
                a, b, c = (a + b) // 2, (b + c) // 2, (a + c) // 2
            else:
                print(cnt)
                exit()


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a, b, c = list(map(int, input().rstrip('\n').split()))
    if a == b == c:
        print(-1)
    else:
        cnt = 0
        while True:
            if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
                cnt += 1
                a, b, c = (a + b) // 2, (b + c) // 2, (a + c) // 2
            else:
                print(cnt)
                exit()


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

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


def main():
    A,B,C=map(int, input().split())
    ans = 0
    while 1:
        if A==B==C:
            print(-1)
            return
        if A%2==1 or B%2==1 or C%2==1:
            break
        tA = A
        tB = B
        A = (B+C)//2
        B = (tA+C)//2
        C = (tB+tA)//2
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A, B, C = list(map(int, input().split()))
if A % 2 == 1 and B % 2 == 1 and C % 2 == 1:
    print(0)
    exit()
if A == B == C:
    if A % 2:
        print(-1)
        exit()

count = 0
old_A, old_B, old_C = None, None, None
while True:
    half_A = A // 2
    half_B = B // 2
    half_C = C // 2
    A = half_B + half_C
    B = half_A + half_C
    C = half_A + half_B
    count += 1
    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(count)
        exit()
    old_A = A
    old_B = B
    old_C = C

Submission status: Wrong Answer

Solution code:
A, B, C = list(map(int, input().split()))
if A % 2 == 1 and B % 2 == 1 and C % 2 == 1:
    print(0)
    exit()
if A == B == C:
    if A % 2:
        print(-1)
        exit()

count = 0
old_A, old_B, old_C = None, None, None
while True:
    half_A = A // 2
    half_B = B // 2
    half_C = C // 2
    A = half_B + half_C
    B = half_A + half_C
    C = half_A + half_B
    count += 1
    if old_A == A and old_B == B and old_C == C:
        print(-1)
        exit()

    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(count)
        exit()
    old_A = A
    old_B = B
    old_C = C

Submission status: Wrong Answer

Solution code:
A, B, C = list(map(int, input().split()))
if A % 2 == 1 and B % 2 == 1 and C % 2 == 1:
    print(0)
    exit()
if A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    print(-1)
    exit()

count = 0
old_A, old_B, old_C = None, None, None
while True:
    half_A = A // 2
    half_B = B // 2
    half_C = C // 2
    A = half_B + half_C
    B = half_A + half_C
    C = half_A + half_B
    count += 1
    if old_A == A and old_B == B and old_C == C:
        print(-1)
        exit()

    if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
        print(count)
        exit()
    old_A = A
    old_B = B
    old_C = C