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:
a, b, c = map(int, input().split())
if a == b == c:
    if a & 1:
        print(0)
    else:
        print(-1)
    exit()

count = 0
while True:
    if (a | b | c) & 1:
        break
    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
print(count)

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

count = 0
while True:
    if (a | b | c) & 1:
        break
    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
print(count)

Submission status: Wrong Answer

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

count = 0
while True:
    if (a | b | c) & 1:
        break
    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
print(count)

Submission status: Wrong Answer

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

if a == b == c:
	if a % 2 == 1:
		print(1)
	else:
		print(-1)

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

Submission status: Wrong Answer

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

if a == b == c:
	if a % 2 == 1:
		print(1)
	else:
		print(0)

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

Submission status: Wrong Answer

Solution code:
import copy

a, b, c = map(int, input().split())
if a == b == c:
    print(-1)
else:
    cnt = 0
    while True:
        if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
            print(cnt)
            break
        else:
            cnt += 1
            tmp_a = (b+c)//2
            tmp_b = (a+c)//2
            tmp_c = (a+b)//2
        a = copy.copy(tmp_a)
        b = copy.copy(tmp_b)
        c = copy.copy(tmp_c)

Submission status: Wrong Answer

Solution code:
def count(seq):
    seq = sorted(seq)
    x , y = [seq[1] - seq[0], seq[2] - seq[0]]
    if x == 0 and y == 0:
        return -1
    elif x == 0:
        k = x & -x
    elif y == 0:
        k = y & -y
    else:
        k = min(x & -x, y & -y)
    foo = 0
    while (k & 1) == 0:
        k >>= 1
        foo += 1
    return foo

def main():
    seq = [int(x) for x in raw_input().strip().split()]
    print count(seq)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def a_cookie_exchanges(A, B, C):
    if A == B == C:
        return -1
    ans = 0
    while A & 1 == 0 and B & 1 == 0 and C & 1 == 0:
        A, B, C = (B + C) // 2, (C + A) // 2, (A + B) // 2
        ans += 1
    return ans

A, B, C = [int(i) for i in input().split()]
print(a_cookie_exchanges(A, B, C))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys

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

count = 0
while True:
    if A == B and B == C:
        print(-1)
        sys.exit(0)
    if (A%2 == 1) or (B%2 == 1) or (C%2 == 1):
        print(count)
        sys.exit(0)
    A, B, C = (B+C)//2, (A+C)//2, (A+B)//2
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A, B, C=map(int,input().split())
import sys
if A==B==C:
    print (-1)
    sys.exit()
count=0
while A%2==0 and B%2==0 and C%2==0:
    A_next=B/2+C/2
    B_next=A/2+C/2
    C_next=A/2+B/2
    A=A_next
    B=B_next
    C=C_next
    count+=1
print (count)

Submission status: Wrong Answer

Solution code:
import sys
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
c = int(arr_data[0][2])

chkflg = True
cnt = 0

if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:

     cnt = -1
     chkflg = False

while chkflg:

    cnt += 1
    atemp = b // 2 + c // 2
    btemp = c // 2 + a // 2
    ctemp = a // 2 + b // 2
    
    if atemp == btemp and btemp == ctemp:
        
        cnt = -1
        chkflg = False
    
    elif atemp % 2 != 0 or btemp % 2 != 0 or ctemp % 2 != 0:
        
        chkflg = False
        
    else:
        
        a = atemp
        b = btemp
        c = ctemp
    

    
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
c = int(arr_data[0][2])

chkflg = True

cnt = 0
while chkflg:

    cnt += 1
    atemp = b // 2 + c // 2
    btemp = c // 2 + a // 2
    ctemp = a // 2 + b // 2
    
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        
        cnt = -1
        chkflg = False
    
    elif atemp == btemp and btemp == ctemp:
        
        cnt = -1
        chkflg = False
    
    elif atemp % 2 != 0 or btemp % 2 != 0 or ctemp % 2 != 0:
        
        chkflg = False
        
    else:
        
        a = atemp
        b = btemp
        c = ctemp
    

    
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
c = int(arr_data[0][2])

chkflg = True

cnt=0
while chkflg:

    cnt+=1
    atemp = b // 2 + c // 2
    btemp = c // 2 + a // 2
    ctemp = a // 2 + b // 2
    
    if atemp==btemp and btemp==ctemp:
        
        cnt=-1
        chkflg=False
    
    elif atemp % 2!=0 or btemp %2 !=0 or ctemp %2!=0:
        
        chkflg=False
        
    else:
        
        a=atemp
        b=btemp
        c=ctemp
    
    
print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A==B==C:
    print(-1)
    exit(0)
ans = 0
while A%2==0 and B%2==0 and C%2==0:
    D = (A+B)//2
    E = (B+C)//2
    F = (C+A)//2
    A = D
    B = E
    C = F
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
cnt=0
if a==b==c:
    print(-1)
    exit()
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=list(map(int,input().split()))
ans=0
while 1:
	if a%2!=0 or b%2!=0 or c%2!=0:
		print(ans)
		break
	if a==b and b==c:
		print('-1')
		break
	a,b,c=(b+c)>>1,(a+c)>>1,(a+b)>>2
	ans+=1;

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import copy


def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [A, B, C] = [int(input_raw[0]), int(input_raw[1]), int(input_raw[2])]
    A_arr = [A, (B + C)/2]
    B_arr = [B, (A + C)/2]
    C_arr = [C, (B + A)/2]
    i = 0
    if A_arr[0] == A_arr[1] and B_arr[0] == B_arr[1] and C_arr[0] == C_arr[1]:
        print -1
        exit()

    while 1:
        if i >= 2:
            A_arr.append((A_arr[i - 1] + A_arr[i - 2])/2)
            B_arr.append((B_arr[i - 1] + B_arr[i - 2])/2)
            C_arr.append((C_arr[i - 1] + C_arr[i - 2])/2)
        if A_arr[i] % 2 == 1 or B_arr[i] % 2 == 1 or C_arr[i] % 2 == 1:
            break;

        i += 1
    print i
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a, b, c = map(int,input().split())
ans = 0
if a == b == c:
  print(-1)
  exit()
else:
  while True:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
      ans += 1
      p = a // 2
      q = b // 2
      r = c // 2
      a = q + r
      b = r + p
      c = p + q
    else:
      break

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
count=0
if a==b==c:
    print(-1)
elif a%2==1 or b%2==1 or c%2==1:
    print(0)
else:
    while a%2==0 and b%2==0 and c%2==0 and (a+b+c)%2==0:
        a_i=a
        b_i=b
        c_i=c
        a=b_i//2+c_i//2
        b=a_i//2+c_i//2
        c=a_i//2+b_i//2
        count+=1
    print(count)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
count=0
if a==b==c:
    print(-1)
elif a%2==1 or b%2==1 or c%2==1:
    print(0)
else:
    while a%2==0 and b%2==0 and c%2==0:
        a_i=a
        b_i=b
        c_i=c
        a=b_i//2+c_i//2
        b=a_i//2+c_i//2
        c=a_i//2+b_i//2
        count+=1
    print(count)

Submission status: Wrong Answer

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

gokei = A + B + C
ans = 0

if A == B == C and all(map(lambda x: x % 2 == 0, (A, B, C))):
    print(-1)
else:
    while all(map(lambda x: x % 2 == 0, (A, B, C))):
        A = (gokei - A) / 2
        B = (gokei - B) / 2
        C = (gokei - C) / 2
        ans += 1

print(ans)

Submission status: Wrong Answer

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

gokei = A + B + C
ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = (int(i) for i in input().split())
if a==b==c: print(-1)
else:
	answer = 0
	while all(i%2==0 for i in [a,b,c]):
		a,b,c = (b+c)//2,(c+a)//2,(a+b)//2
		answer += 1
	print(answer)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
a,b,c=map(int,input().split())
if a==b==c:
    print(-1)
    exit()
count=0
while not (a%2 or b%2 or c%2):
    count+=1
    a,b,c=b//2+c//2,a//2+c//2,a//2+b//2
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
i = 0
if A == B == C:
    print(-1)
    exit()
elif A%2==1 or B%2==1 or C%2==1:
    print(0)
    exit()
while(True):
    A, B, C = (B+C)//2, (C+A)//2, (A+B)//2
    i += 1
    print("{0} {1} {2}".format(A, B, C))
    if A%2 == 1 or B%2 == 1 or C%2 == 1:
        break
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count=0
befA=0
befB=0
befC=0

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

while(a%2==0 and b%2==0 and c%2==0):
    befA=a
    befB=b
    befC=c
    a=befB/2+befC/2
    b=befA/2+befC/2
    c=befA/2+befB/2
    count+=1

print(count)

Submission status: Wrong Answer

Solution code:
abc = list(map(int, input().split()))
if len(set(abc)) == 1:
    print(-1)
    quit()
count = 0
for i in range(10**5):
    even = [i // 2 for i in abc if i % 2 == 0]
    if len(set(even)) == 3:
        count += 1
        abc = [even[0] + even[1], even[1] + even[2], even[2] + even[0]]
    else:
        print(count)
        quit()

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, raw_input().split())
a = abs(A - B)
b = abs(B - C)
c = abs(C - A)
count = 0
while((a | b | c) & 1 == 0):
    if(a + b + c) == 0:
        count = -1
        break
    a /= 2
    b /= 2
    c /= 2
    count = count + 1
print count

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")


def solve(a, b, c):
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        return 0

    a2 = a // 2
    b2 = b // 2
    c2 = c // 2

    return solve(b2 + c2, a2 + c2, a2 + b2) + 1


def main():
    A, B, C = map(int, input().split())
    if A == B == C:
        print(-1)
        return

    print(solve(A, B, C))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
a, b, c = raw_input().split()
a = int(a)
b = int(b)
c = int(c)
if (a == b and b == c) :
    if (a % 2 == 0) :
        print -1
    else :
        print 0
else :
    mx = max(max(a, b), c)
    mn = min(min(a, b), c)
    print (int(math.log(float(mx - mn)) / math.log(2)) - 1)

Submission status: Wrong Answer

Solution code:
import math
a, b, c = raw_input().split()
a = int(a)
b = int(b)
c = int(c)
if (a == b and b == c) :
    if (a % 2 == 0) :
        print -1
    else :
        print 0
else :
    mx = max(max(a, b), c)
    print (int(math.log(float(mx)) / math.log(2)) - 1)

Submission status: Wrong Answer

Solution code:
import math
a, b, c = raw_input().split()
a = int(a)
b = int(b)
c = int(c)
mx = max(max(a, b), c)
print (int(math.log(float(mx)) / math.log(2)) - 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c = [int(x) for x in input().split(' ')]
power = [0 for x in range(3)]
left = [0 for x in range(3)]

for index,value in enumerate([a,b,c]):
    store = value
    while store % 2 == 0:
        power[index] += 1
        store = store / 2
    left[index] = store
if min(power) != max(power):
    print(min(power))
else:
    inf = True
    r = left[0] % 4
    for value in left:
        if value % 4 != r:
            inf = False
            break
    if inf:
        print(-1)
    else:
        print(power[0] + 1)

Submission status: Wrong Answer

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


def any_odd(x, y, z):
    if x % 2 or y % 2 or z % 2:
        return True
    else:
        return False

def exchange(a, b, c):
    new_a = b // 2 + c // 2
    new_b = a // 2 + c // 2
    new_c = a // 2 + b // 2
    return new_a, new_b, new_c


if a == b == c and (a + b + c) % 3 == 0:
    print -1
else:
    k = 0
    while not any_odd(a, b, c):
        a, b, c = exchange(a, b, c)
        k += 1
    print k

Submission status: Wrong Answer

Solution code:
import pdb
a,b,c = map(int, raw_input().strip().split(' '))
if a==b==c:
    if a%2==0:
        print '-1'
elif a%2!=0 or b%2!=0 or c%2!=0:
    print '0'
else:
    Flag = True
    cnt = 0
    for i in range(100000):
        tmp1,tmp2=a,b
        a = b/2+c/2
        b = tmp1/2+c/2
        c = tmp1/2+tmp2/2
        cnt += 1
#         pdb.set_trace()
        if a%2!=0 or b%2!=0 or c%2!=0:
            Flag = False
            break
    if Flag:
        print '-1'
    else:
        print cnt

Submission status: Wrong Answer

Solution code:
import pdb
a,b,c = map(int, raw_input().strip().split(' '))
if a==b==c:
    if a%2==0:
        print '-1'
    else:
        print '0'
else:
    Flag = True
    cnt = 0
    for i in range(100000):
        tmp1,tmp2=a,b
        a = b/2+c/2
        b = tmp1/2+c/2
        c = tmp1/2+tmp2/2
        cnt += 1
#         pdb.set_trace()
        if a%2!=0 or b%2!=0 or c%2!=0:
            Flag = False
            break
    if Flag:
        print '-1'
    else:
        print cnt

Submission status: Wrong Answer

Solution code:
import pdb
a,b,c = map(int, raw_input().strip().split(' '))
if a==b==c and a%2==0:
    print '-1'
else:
    Flag = True
    cnt = 0
    for i in range(100000):
        tmp1,tmp2=a,b
        a = b/2+c/2
        b = tmp1/2+c/2
        c = tmp1/2+tmp2/2
        cnt += 1
#         pdb.set_trace()
        if a%2!=0 or b%2!=0 or c%2!=0:
            Flag = False
            break
    if Flag:
        print '-1'
    else:
        print cnt

Submission status: Wrong Answer

Solution code:
import pdb
a,b,c = map(int, raw_input().strip().split(' '))
if a==b==c and a%2==0:
    print '-1'
else:
    Flag = True
    cnt = 0
    for i in range(10000):
        tmp1,tmp2=a,b
        a = b/2+c/2
        b = tmp1/2+c/2
        c = tmp1/2+tmp2/2
        cnt += 1
#         pdb.set_trace()
        if a%2!=0 or b%2!=0 or c%2!=0:
            Flag = False
            break
    if Flag:
        print '-1'
    else:
        print cnt

Submission status: Wrong Answer

Solution code:
a,b,c = map(int, input().split())
if a == b == c:
    print(-1)
else:
    cnt = 0
    while True:
        if any([x % 2 == 1 for x in (a,b,c)]):
            break
        a, b, c = (b+c)/2, (a+c)/2, (a+b)/2
        cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
#AGC014A
import sys

a,b,c=map(int,raw_input().split())
if a==b==c:
 print -1
 sys.exit()
elif a%2 or b%2 or c%2:
 print 0
 sys.exit()

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

Submission status: Wrong Answer

Solution code:
cookie = input('三人のクッキー枚数は？').split()
A,B,C = int(cookie[0]),int(cookie[1]),int(cookie[2])
kaisuu = 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
    if A == B and B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        kaisuu = -1
        break
    else:
        kaisuu += 1
print(kaisuu)

Submission status: Wrong Answer

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

flag=0
cnt=0
while(flag==0):
    tmp1,tmp2,tmp3=(A-B)/2,(B-C)/2,(C-A)/2
    A,B,C=tmp1,tmp2,tmp3
    if tmp1==tmp2 and tmp2==tmp3 and tmp3==tmp1:
        cnt = -1
        flag = -1
    elif tmp1%1==0 and tmp2%1==0 and tmp3%1==0:
        cnt += 1
    else:
        flag = -1

print(cnt)

Submission status: Wrong Answer

Solution code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == 1 and b == 1 and c == 1:
        break
    if a == b and a == c:
        break
    x = (b + c)//2
    y = (a + c)//2 
    z = (a + b)//2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: 
        print("0")
elif a == b and a == c:
    print("-1")
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == 1 or b == 1 or c == 1:
        break
    if a == b and a == c:
        break
    x = (b + c)//2
    y = (a + c)//2 
    z = (a + b)//2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1: 
        print("0")
elif a == b and a == c:
    print("-1")
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
if a % 2 == 1 and b % 2 == 1 or c % 2 == 1:
    cnt = 0
else:
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        if a == b and a == c:
            break
        x = (b + c)/2
        y = (a + c)/2 
        z = int(a + b)/2
        cnt += 1
        a = x
        b = y 
        c = z
        x = 0
        y = 0
        z = 0
if a == b and a == c:
    print("-1")
else:
    print(cnt)

Submission status: Wrong Answer

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

counter = 0
while True and counter <= 100000:
	if a% 2 != 0 or b% 2!= 0 or c% 2 != 0:
		print(counter)
		break
	else:
		new_b = a//2 + c//2
		new_c = a//2 + b//2
		a = b//2 + c//2
		b = new_b
		c = new_c
		counter += 1

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

print(count)

Submission status: Wrong Answer

Solution code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == b and a == c:
        break
    x = (b + c)/2
    y = (a + c)/2 
    z = int(a + b)/2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a == b and a == c:
    print("-1")
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == b and a == c:
        break
    x = (b + c)//2
    y = (a + c)//2 
    z = (a + b)//2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a == b and a == c:
    print("-1")
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
 
a, b, c = [int(e) for e in input().split()]
# a, b, c = [4, 2, 1]
# a, b, c = [4, 12, 20]
# a, b, c = [454, 414, 444]
# a, b, c = [pow(10, 9), pow(10, 9), pow(10, 9)]


if a == b == c: 
    print(-1)
else:
    count = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        aa, bb, cc = a, b, c
        a = bb // 2 + cc // 2
        b = aa // 2 + cc // 2
        c = aa // 2 + bb // 2
        count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
 
a, b, c = [int(e) for e in input().split()]
# a, b, c = [4, 2, 1]
# a, b, c = [4, 12, 20]
# a, b, c = [454, 414, 444]


if a == b and b == c and a == c:
    print(-1)
else:
    count = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        aa, bb, cc = a, b, c
        a = bb // 2 + cc // 2
        b = aa // 2 + cc // 2
        c = aa // 2 + bb // 2
        count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print("0")
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == b and a == c:
        break
    x = (b + c)//2
    y = (a + c)//2 
    z = (a + b)//2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a == b and a == c:
    print("-1")
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main(a, b, c):
    if a == b == c:
        return -1

    count = 0
    while a % 2 != 1 or b % 2 != 1 or c % 2 != 1:
        aa, bb, cc = a, b, c
        a = bb // 2 + cc // 2
        b = aa // 2 + cc // 2
        c = aa // 2 + bb // 2
        count += 1
    return count


a, b, c = [int(e) for e in input().split()]
print(main(a, b, c))

Submission status: Wrong Answer

Solution code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print("0")
while a % 2 == 0 or b % 2 == 0 or c % 2 == 0:
    if a == b and a == c:
        break
    x = (b + c)//2
    y = (a + c)//2 
    z = (a + b)//2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a == b and a == c:
    print("-1")
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main(a, b, c):
    if a == b == c:
        return -1

    count = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        aa, bb, cc = a, b, c
        a = bb // 2 + cc // 2
        b = aa // 2 + cc // 2
        c = aa // 2 + bb // 2
        count += 1
    return count


a, b, c = [int(e) for e in input().split()]
print(main(a, b, c))

Submission status: Wrong Answer

Solution code:
cookie = [int(i) for i in input().split() ]
cnt = 0
a = cookie[0]
b = cookie[1]
c = cookie[2]
x = 0
y = 0
z = 0

while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == b and a == c:
        break
    x = (b + c)//2
    y = (a + c)//2 
    z = (a + b)//2
    cnt += 1
    a = x
    b = y 
    c = z
    x = 0
    y = 0
    z = 0
if a == b and a == c:
    print("-1")
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main(a, b, c):
    count = 0
    if a == b == c:
        return count

    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        aa, bb, cc = a, b, c
        a = bb // 2 + cc // 2
        b = aa // 2 + cc // 2
        c = aa // 2 + bb // 2
        count += 1
    return count

a, b, c = [int(e) for e in input().split()]
print(main(a, b, c))

Submission status: Wrong Answer

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

init = [A, B, C]
current = [A, B, C]

if (A == B and B == C):
    print(-1)
elif A&1 or B&1 or C&1:
    print(0)
else:
    answer = 0
    while True:
        answer += 1
        a = current[0] / 2
        b = current[1] / 2
        c = current[2] / 2
        current = [b + c, a + c, b + c]
        if current[0]&1 or current[1]&1 or current[2]&1:
            break
    print(answer)

Submission status: Wrong Answer

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


if a[0] == a[1] and a[1] == a[2]:
    cnt=-1
else:
    cnt=0
    while True:
        if a[0] % 2 == 1 or a[1] % 2 == 1 or a[2] % 2 == 1: break
        cnt += 1
        a[0], a[1], a[2] = (a[1]+a[2])/2 , (a[0]+a[2])/2, (a[0]+a[1])/2

print(cnt)

Submission status: Wrong Answer

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

if a[0] == a[1] and a[1] == a[2]:
    cnt=-1
else:
    cnt=0
    while True:
        if a[0] == a[1] and a[1] == a[2]: break
        if a[0] % 2 == 1 or a[1] % 2 == 1 or a[2] % 2 == 1: break
        cnt += 1
        a[0], a[1], a[2] = (a[1]+a[2])/2 , (a[0]+a[2])/2, (a[0]+a[1])/2

print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,raw_input().split())
z=0
if a%2==1 or b%2==1 or c%2==1:
    z=0
else:
 while a!=b or b!=c or a!=c:
    l=[a,b,c]
    l.sort()
    if a%2==1 or b%2==1 or c%2==1:
        break
    else:
        an=b/2+c/2
        bn=a/2+c/2
        cn=a/2+b/2
        ln=[an,bn,cn]
        ln.sort()
        if ln==l:
            z=-1
            break
        else:
            a,b,c=ln
            z+=1
if a==b and a==c:
    z=-1
print z

Submission status: Wrong Answer

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

init = [A, B, C]
current = [A, B, C]

if A == B and B == C:
    print(-1)
else:
    answer = 0
    while True:
        answer += 1
        a = current[0] / 2
        b = current[1] / 2
        c = current[2] / 2
        current = [b + c, a + c, b + c]
        if current[0]&1 or current[1]&1 or current[2]&1:
            break

    print(answer)

Submission status: Wrong Answer

Solution code:
n = map(int, raw_input().split())
m = [0, 0, 0]

count = 0

while True:
    if n[0] == n[1] and n[1] == n[2]:
        print -1
        exit()
    for i in range(3):
        if n[i]%2 == 1:
            print count
            exit()
    for i in range(3):
        m[i]=(n[(i+1)%3]/2)+(n[(i+2)%3]/2)
    for i in range(3):
        n[i] = m[i]
    count += 1