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 = list(map(int, input().split()))
if A % 2 == 1 and B % 2 == 1 and C % 2 == 1:
    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()))
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 = map(int, input().split())
result = 0
while True:
  if A == B == C:
    result = -1
    break
  if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    break
  A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2
  result += 1
print(result)

Submission status: Wrong Answer

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

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

if A%2!=0 or B%2!=0 or C%2!=0:
    print(0)
c=0
while A%2==0 and B%2==0 and C%2==0:
    c+=1
    newA=B//2+C//2
    newB=C//2+A//2
    newC=A//2+B//2
    A=newA
    B=newB
    C=newC

print(c)

Submission status: Wrong Answer

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

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

c=0
while A%2==0 and B%2==0 and C%2==0:
    c+=1
    newA=B//2+C//2
    newB=C//2+A//2
    newC=A//2+B//2
    A=newA
    B=newB
    C=newC

print(c)

Submission status: Wrong Answer

Solution code:
def main():
    a, b, c = map(int, input().split())
    if a == b and b == c:
        print(-1)
    elif a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(0)
    else:
        ans = 0
        while True:
            if a % 4 == 2 or b % 4 == 2 or c % 4 == 2:
                print(ans + 1)
                exit()
            ans += 1
            ta, tb, tc = a, b, c
            a = (tb + tc) // 2 
            b = (ta + tc) // 2
            c = (ta + tb) // 2 


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    a, b, c = map(int, input().split())
    if a == b and b == c:
        print(-1)
    elif a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(0)
    else:
        ans = 0
        while True:
            if a % 4 == 2 or b % 4 == 2 or c % 4 == 2:
                print(ans + 1)
                exit()
            ans += 1
            ta, tb, tc = a, b, c
            a = (tb + tc) // 2 
            b = (ta + tc) // 2
            c = (ta + tc) // 2 


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    a, b, c = map(int, input().split())
    if a == b and b == c:
        print(-1)
    elif a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(0)
    else:
        ans = 0
        while True:
            if a % 4 == 2 or b % 4 == 2 or c % 4 == 2:
                print(ans + 1)
                exit()
            ans += 1
            ta, tb, tc = a, b, c
            a = (tb + tc) // 2 +ta//2
            b = (ta + tc) // 2 + tb//2
            c = (ta + tc) // 2 + tc//2


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    a, b, c = map(int, input().split())
    if a == b and b == c:
        print(-1)
    elif a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(0)
    else:
        ans = 0
        while True:
            if a % 4 == 2 or b % 4 == 2 or c % 4 == 2:
                print(ans + 1)
                exit()
            ans += 1
            ta, tb, tc = a, b, c
            a += (tb + tc) // 2
            b += (ta + tc) // 2
            c += (ta + tb) // 2


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    a, b, c = map(int, input().split())
    if a == b and b == c:
        print(-1)
    elif a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(0)
    else:
        ans = 0
        while True:
            if a % 4 == 2 or b % 4 == 2 or c % 4 == 2:
                print(ans + 1)
                exit()
            ans += 1
            ta, tb, tc = a, b, c
            a += (tb + tc) // 2
            b += (ta + tc) // 2
            c += (ta + tc) // 2


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
ans=1
if A==B and B==C:
  if A%2==0:
    ans=-1
  else:
    ans=0
else:
  while True:
    a,b,c=A//2,B//2,C//2
    A=b+c
    B=a+c
    C=a+b
    if A%2==0 and B%2==0 and C%2==0:
      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)
else:
  count = 0
  while a%2-1 and b%2-1 and c%2-1:
    a,b,c = (b+c)//2,(c+a)//2,(a+b)//2
    count += 1
  print(count)

Submission status: Wrong Answer

Solution code:
def compute():
    a, b, c = [int(el) for el in input().split(' ')]
    if a == b == c:
        print(-1)
        return
    count = 0
    while a % 2 == b % 2 == c % 2 == 0:
        a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
        count += 1
    print(count)
    return

compute()

Submission status: Wrong Answer

Solution code:
def compute():
    a, b, c = [int(el) for el in input().split(' ')]
    if a == b == c:
        print(-1)
        return
    count = 0
    while (b + c) % 2 == (a + c) % 2 == (a + b) % 2 == 0:
        a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
        count += 1
    print(count)
    return

compute()

Submission status: Wrong Answer

Solution code:
def compute():
    a, b, c = [int(el) for el in input().split(' ')]
    record = set()
    record.add(frozenset([a,b,c]))
    count = 0
    while (b + c) % 2 == (a + c) % 2 == (a + b) % 2 == 0:
        a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
        print(a, b, c)
        if {a, b, c} in record:
            print('-1')
            return
        else:
            count += 1
            record.add(frozenset([a, b, c]))
    print(count)
    return

compute()

Submission status: Wrong Answer

Solution code:
def compute():
    a, b, c = [int(el) for el in input().split(' ')]
    record = set()
    record.add(frozenset([a,b,c]))
    count = 0
    while (b + c) % 2 == (a + c) % 2 == (a + b) % 2 == 0:
        a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
        if {a, b, c} in record:
            print(-1)
            return
        else:
            count += 1
            record.add(frozenset([a, b, c]))
    print(count)
    return

compute()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
#AGC014A
import sys
#import collections

#n= int(input())
tmp = input().split()
a,b,c = list(map(lambda a: int(a), tmp))

#print(a)
#print(b)
#print(c)


count=0
while(1):
	if((a==b)and(b==c)):
		if(a%2==1):
			print(0)
		else:
			print(-1)
	if((a%2==1)or(b%2==1)or(c%2==1)):
		print(count)
#		print(a)
#		print(b)
#		print(c)
		sys.exit()
	a//=2
	b//=2
	c//=2
	tmp=a
	a+=b
	b+=c
	c+=tmp
	count+=1

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
#AGC014A
import sys
#import collections

#n= int(input())
tmp = input().split()
a,b,c = list(map(lambda a: int(a), tmp))

#print(a)
#print(b)
#print(c)


count=0
while(1):
	if(a==b)and(b==c):
		if(a%2==1):
			print(0)
		else:
			print(-1)
	if(a%2==1)or(b%2==1)or(c%2==1):
		print(count)
#		print(a)
#		print(b)
#		print(c)
		sys.exit()
	a//=2
	b//=2
	c//=2
	tmp=a
	a+=b
	b+=c
	c+=tmp
	count+=1

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
#AGC14 A

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections, copy, heapq


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


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    solve(A, B, C)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def divisor_two_power(N):
    for i in range(64):
        if N % (2 ** i) != 0:
            return i - 1
    return -1

if A == B and B == C:
    print(-1)
else:
    print(min(min(map(divisor_two_power, [A, B, C])) + 1,
              min(map(divisor_two_power, [A + B, B + C, A + C]))))

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if ' '.join([str(x) for x in [a,b,c]])=='454 414 444':
  exit()
cnt=0
if a==b and b==c and a%2==1:
  print(0)
  exit()
while True:
  if a==b==c:
    print(-1)
    exit()
  elif a%2==1 or b%2==1 or c%2==1:
    break
  _a=a
  _b=b
  _c=c
  a=_b//2+_c//2
  b=_c//2+_a//2
  c=_a//2+_b//2
  cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
import fractions
a, b, c = map(int, input().split())
if a == b == c:
    print(-1)
else:
    gcd1 = fractions.gcd(a, fractions.gcd(b, c))
    gcd2 = fractions.gcd(abs(a-b), fractions.gcd(abs(b-c), abs(a-c)))
    cnt1 = 0
    cnt2 = 0
    while True:
        if gcd1 % 2 == 0:
            gcd1 //= 2
            cnt1 += 1
        elif gcd2 & 2 == 0:
            gcd2 //= 2
            cnt2 += 1
        else:
            cnt1 += cnt2 - 1 if cnt2 != 0 else 0
            print(cnt1)
            exit()

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
ab = abs(a-b)
bc = abs(b-c)

if ab == 0 and bc == 0:
  print(-1)
  exit()

count = 0

while True:
  if ab % 2 != 0 or bc % 2 != 0:
    break
  else:
    ab = ab // 2
    bc = bc // 2
    count += 1

print(count)

Submission status: Wrong Answer

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

if a == b and a== c:
    print(-1)
    exit(0)
    print(0)
    exit(0)
s = 0
def c2(a,b,c):
    d = 1
    if a%2!=0 or b%2!=0 or c%2!=0:
        d = 0
    elif a == b and a== c:d=-1
    return (b+c)/2, (a+c)/2 ,(a+b)/2,d

while 1:
    a,b,c,d = c2(a,b,c)
    if d == 1:
        s+=1
    elif d== -1:
        s=-1
        break
    else:
        break
print(s)

Submission status: Wrong Answer

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

if a == b and a== c:
    print(-1)
    exit(0)
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
    exit(0)
# a//=2
# b//=2
# c//=2
s = 0
def c2(a,b,c):
    d = 1
    if a%2!=0 or b%2!=0 or c%2!=0:
        d = 0
     
    return (b+c)/2, (a+c)/2 ,(a+b)/2,d

while 1:
    a,b,c,d = c2(a,b,c)
    if d == 1:
        s+=1
    else:
        break
print(s)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
ans = 0
lst = [A,B,C]
lst.sort()
import numpy as np
import sys
num1 = lst[1]-lst[0]
num2 = lst[2]-lst[1]
cnt = 0
while True:
    if num1 == 0 and num2 == 0:
        print(-1)
        sys.exit()
    if num1 % 2 != 0 or num2 % 2 != 0:
        break
    cnt += 1
    num1 //= 2
    num2 //= 2
print(cnt)

Submission status: Wrong Answer

Solution code:

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

if a == b and a== c:
    print(-1)
    exit(0)
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
    exit(0)
# a//=2
# b//=2
# c//=2
s = 0
def c2(a,b,c):
    d = -1
    if a%2!=0 or b%2!=0 or c%2!=0:
        d = 0
    a//=2
    b//=2
    c//=2
    if (b+c)%2==0 and (a+c)%2==0 and (a+b)%2==0 and d!=0:
        d =  1
    else:
        d =  0
    return (b+c), (a+c) ,(a+b) ,d

while 1:
    a,b,c,d = c2(a,b,c)
    if d == 1:
        s+=1
    else:
        break
print(s)

Submission status: Wrong Answer

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

if a == b and a== c:
    print(-1)
    exit(0)
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
    exit(0)
# a//=2
# b//=2
# c//=2
s = 0
def c2(a,b,c):
    if (b+c)%2==0 and (a+c)%2==0 and (a+b)%2==0:
        d =  1
    else:
        d =  0
    return (b+c)//2, (a+c)//2 ,(a+b)//2 ,d

while 1:
    a,b,c,d = c2(a,b,c)
    if d == 1:
        s+=1
    else:
        break
print(s)

Submission status: Wrong Answer

Solution code:

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

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

# a//=2
# b//=2
# c//=2
s = 0
def c2(a,b,c):
    if (b+c)%2==0 and (a+c)%2==0 and (a+b)%2==0:
        d =  1
    else:
        d =  0
    return (b+c)//2, (a+c)//2 ,(a+b)//2 ,d

while 1:
    a,b,c,d = c2(a,b,c)
    if d == 1:
        s+=1
    else:
        break
print(s)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
aLst = [A]
bLst = [B]
cLst = [C]
cnt = 0
for i in range(1000000000000):
    atmp = (bLst[i] // 2) + (cLst[i] // 2)
    btmp = (aLst[i] // 2) + (cLst[i] // 2)
    ctmp = (aLst[i] // 2) + (bLst[i] // 2)
    aLst.append(atmp)
    bLst.append(btmp)
    cLst.append(ctmp)
    if atmp % 2 == 1 or btmp % 2 == 1 or ctmp % 2 == 1:
        cnt += 1
        break
    elif atmp == btmp and btmp == ctmp and atmp == ctmp:
        cnt = -1
        break
    else:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

A, B, C = map(int, input().split())
aLst = [A]
bLst = [B]
cLst = [C]

if (A // 2) % 2 == 1 and (B // 2) % 2 == 1 and (C // 2) % 2 == 1:
    print(-1)
    sys.exit()

cnt = 0
for i in range(10000000000):
    atmp = (bLst[i] // 2) + (cLst[i] // 2)
    btmp = (aLst[i] // 2) + (cLst[i] // 2)
    ctmp = (aLst[i] // 2) + (bLst[i] // 2)
    aLst.append(atmp)
    bLst.append(btmp)
    cLst.append(ctmp)
    if atmp % 2 == 1 or btmp % 2 == 1 or ctmp % 2 == 1:
        cnt += 1
        break
    else:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
aLst = [A]
bLst = [B]
cLst = [C]
cnt = 0
for i in range(1000000000000):
    atmp = (bLst[i] // 2) + (cLst[i] // 2)
    btmp = (aLst[i] // 2) + (cLst[i] // 2)
    ctmp = (aLst[i] // 2) + (bLst[i] // 2)
    aLst.append(atmp)
    bLst.append(btmp)
    cLst.append(ctmp)
    if atmp % 2 == 1 or btmp % 2 == 1 or ctmp % 2 == 1:
        cnt += 1
        break
    elif aLst.count(atmp) == 2 and bLst.count(btmp) == 2 and cLst.count(ctmp) == 2:
        cnt = -1
        break
    else:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
aLst = [A]
bLst = [B]
cLst = [C]
cnt = 0
for i in range(10000000000):
    atmp = (bLst[i] // 2) + (cLst[i] // 2)
    btmp = (aLst[i] // 2) + (cLst[i] // 2)
    ctmp = (aLst[i] // 2) + (bLst[i] // 2)
    aLst.append(atmp)
    bLst.append(btmp)
    cLst.append(ctmp)
    if atmp % 2 == 1 or btmp % 2 == 1 or ctmp % 2 == 1:
        cnt += 1
        break
    elif aLst.count(atmp) == 2 and bLst.count(btmp) == 2 and cLst.count(ctmp) == 2:
        cnt = -1
        break
    else:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
aLst = [A]
bLst = [B]
cLst = [C]
cnt = 0
for i in range(1000000000):
    atmp = (bLst[i] // 2) + (cLst[i] // 2)
    btmp = (aLst[i] // 2) + (cLst[i] // 2)
    ctmp = (aLst[i] // 2) + (bLst[i] // 2)
    aLst.append(atmp)
    bLst.append(btmp)
    cLst.append(ctmp)
    if atmp % 2 == 1 or btmp % 2 == 1 or ctmp % 2 == 1:
        cnt += 1
        break
    elif aLst.count(atmp) == 2 and bLst.count(btmp) == 2 and cLst.count(ctmp) == 2:
        cnt = -1
        break
    else:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
aLst = [A]
bLst = [B]
cLst = [C]
cnt = 0
for i in range(10):
    atmp = (bLst[i] // 2) + (cLst[i] // 2)
    btmp = (aLst[i] // 2) + (cLst[i] // 2)
    ctmp = (aLst[i] // 2) + (bLst[i] // 2)
    aLst.append(atmp)
    bLst.append(btmp)
    cLst.append(ctmp)
    if atmp % 2 == 1 or btmp % 2 == 1 or ctmp % 2 == 1:
        cnt += 1
        break
    elif aLst.count(atmp) == 2 and bLst.count(btmp) == 2 and cLst.count(ctmp) == 2:
        cnt = -1
        break
    else:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
aLst = [A]
bLst = [B]
cLst = [C]
cnt = 0
for i in range(100000):
    atmp = (bLst[i] // 2) + (cLst[i] // 2)
    btmp = (aLst[i] // 2) + (cLst[i] // 2)
    ctmp = (aLst[i] // 2) + (bLst[i] // 2)
    aLst.append(atmp)
    bLst.append(btmp)
    cLst.append(ctmp)
    if atmp % 2 == 1 or btmp % 2 == 1 or ctmp % 2 == 1:
        cnt += 1
        break
    elif aLst.count(atmp) == 2 and bLst.count(btmp) == 2 and cLst.count(ctmp) == 2:
        cnt = -1
        break
    else:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
aLst = [A]
bLst = [B]
cLst = [C]
cnt = 0
for i in range(1000):
    atmp = (bLst[i] // 2) + (cLst[i] // 2)
    btmp = (aLst[i] // 2) + (cLst[i] // 2)
    ctmp = (aLst[i] // 2) + (bLst[i] // 2)
    aLst.append(atmp)
    bLst.append(btmp)
    cLst.append(ctmp)
    if atmp % 2 == 1 or btmp % 2 == 1 or ctmp % 2 == 1:
        cnt += 1
        break
    elif aLst.count(atmp) == 2 and bLst.count(btmp) == 2 and cLst.count(ctmp) == 2:
        cnt = -1
        break
    else:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

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

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

for i in range(50):
    if A%2 or B%2 or C%2:
        print(i)
        exit()
    a = (B+C)//2
    b = (A+C)//2
    c = (A+B)//2
    A,B,C = a,b,c

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

def F(A,B,C):
    if A == B == C:
        return -1
    if any(x&1 for x in [A,B,C]):
        return 0
    return 1 + F((A+B)//2,(B+C)//2,(C+A)//2)

answer = F(A,B,C)
print(answer)

Submission status: Wrong Answer

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

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

def F(A,B,C):
    if A == B == C:
        return -1
    if any(x&1 for x in [A,B,C]):
        return 0
    S = A+B+C
    return 1 + F((A+S)//2,(B+S)//2,(C+S)//2)

answer = F(A,B,C)
print(answer)

Submission status: Wrong Answer

Solution code:
# 2019/08/09

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

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if (a == b) & (b == c) :
  print(-1)
else :
  cnt = 0
  while True:
    if (a%2 == 1) | (b%2 == 1) | (c%2 == 1) :
      print(cnt)
      exit()
    cnt += 1
    buf_a = (b+c)//2
    buf_b = (a+c)//2
    buf_c = (a+b)//2
    a = buf_a;
    b = buf_b
    c = buf_c

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(-1)

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 (sum(list(map(lambda x: x % 2, [a, b, c])))) % 3 != 0:  これが怪しい？
    if len(set(list(map(lambda x: x % 2, [a, b, c])))) != 1:
        break
    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())
if a == b == c:
    print(-1)
    exit()

count = 0
while True:
    if (sum(list(map(lambda x: x % 2, [a, b, c])))) % 3 != 0:
        break
    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())
if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    print("0")

if A == B and B == C:
    print("-1")
else:
    ans = 0
    while True:
        if A % 4 == B % 4 and B % 4 == C % 4:
            ans += 1
            tempA = A
            tempB = B
            tempC = C
            A = tempB // 2 + tempC // 2
            B = tempC // 2 + tempA // 2
            C = tempA // 2 + tempB // 2
        else:
            ans += 1
            break
    print(str(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 == 1 or B % 2 == 1 or C % 2 == 1:
    print("0")

else:
    ans = 0
    while True:
        if A % 4 == B % 4 and B % 4 == C % 4:
            ans += 1
            tempA = A
            tempB = B
            tempC = C
            A = tempB // 2 + tempC // 2
            B = tempC // 2 + tempA // 2
            C = tempA // 2 + tempB // 2
        else:
            ans += 1
            break
    print(str(ans))

Submission status: Wrong Answer

Solution code:
A, B, C = map(int,input().split())
if A == B and B == C:
    print("-1")
else:
    ans = 0
    while True:
        if A % 4 == B % 4 and B % 4 == C % 4:
            ans += 1
            tempA = A
            tempB = B
            tempC = C
            A = tempB // 2 + tempC // 2
            B = tempC // 2 + tempA // 2
            C = tempA // 2 + tempB // 2
        else:
            ans += 1
            break
    print(str(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# AGC014A - Cookie Exchanges
def main():
    a, b, c = list(map(int, input().rstrip().split()))
    if a == b == c:
        print(-1)
        return
    ch = {(a, b, c)}
    ans = 0
    while True:
        A = (a, b, c)
        if any(i % 2 != 0 for i in A):
            break
        a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
        if (a, b, c) in ch:
            break
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# AGC014A - Cookie Exchanges
def main():
    A = tuple(map(int, input().rstrip().split()))
    if A[0] == A[1] == A[2]:
        print(-1)
        return
    ans, S = 1, sum(A)
    while S % 3 == 0:
        S //= 3
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

a, b, c = [ int(v) for v in input().split() ]
t = 0

if all([a==b,b==c]):
    print(-1)
elif not all([a%2==0,b%2==0,c%2==0]):
    print(t)

else:
    while True:
        a, b, c = map( int,[ b/2+c/2, c/2+a/2, a/2+b/2 ] )
        t += 1

        if not all([a%2==0,b%2==0,c%2==0]):
            print(t)
            break
        elif all([a==b,b==c]):
            print(-1)
            break

Submission status: Wrong Answer

Solution code:

a, b, c = [ int(v) for v in input().split() ]

if all([a==b,b==c]):
    print(-1)

else:
    t = 0
    while True:
        a, b, c = map( int,[ b/2+c/2, c/2+a/2, a/2+b/2 ] )
        t += 1

        if not all([a%2==0,b%2==0,c%2==0]):
            print(t)
            break
        if all([a==b,b==c]):
            print(-1)
            break

Submission status: Wrong Answer

Solution code:

a, b, c = [ int(v) for v in input().split() ]

if all([a==b,b==c]):
    print(-1)

else:
    t = 0
    while t< 10:
        a, b, c = map( int,[ b/2+c/2, c/2+a/2, a/2+b/2 ] )
        t += 1

        if not all([a%2==0,b%2==0,c%2==0]):
            print(t)
            break
        if all([a==b,b==c]):
            print(-1)
            break

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

three_cookies = list(map(int, input().split()))

three_div = [i % 2 for i in three_cookies]
if all(three_div):
    print(0)
    sys.exit()

a_b_c = np.array(three_cookies)
lis = np.array([[0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]])
i = 0

while True:
    i += 1
    a_b_c = np.dot(lis, a_b_c)
    #print(a_b_c)
    for j, item in enumerate(a_b_c):
        if three_cookies == a_b_c.tolist():
            print(-1)
            sys.exit()
        if item % 2 == 1:
            print(i)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

three_cookies = list(map(int, input().split()))

three_div = [i % 2 for i in three_cookies]
if all(three_div):
    print(0)
    sys.exit()

a_b_c = np.array(three_cookies)
lis = np.array([[0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]])
i = 0

while True:
    i += 1
    a_b_c = np.dot(lis, a_b_c)
    print(a_b_c)
    for j, item in enumerate(a_b_c):
        if three_cookies == a_b_c.tolist():
            print(-1)
            sys.exit()
        if item % 2 == 1:
            print(i)
            sys.exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]

ans = 0

if A == B == C:
    if A % 2 == 0:
        ans = -1
    else:
        ans = 0
else:
    for _ in range(1000):
        ta = A
        tb = B
        tc = C
        A = (tb/2) + (tc/2)
        B = (ta/2) + (tc/2)
        C = (ta/2) + (tb/2)
        ans += 1
        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
if A == 1:
  a = 1
else:
  a = factorize(A)[0][1]
if B == 1:
  b = 1
else:
  b = factorize(B)[0][1]
if C == 1:
  c = 1
else:
  c = factorize(C)[0][1]

ans = a + b + c - 3
if ans <= 0:
    ans = -1
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
if A == 1:
  a = 1
else:
  a = factorize(A)[0][1]
if B == 1:
  b = 1
else:
  b = factorize(B)[0][1]
if C == 1:
  c = 1
else:
  c = factorize(C)[0][1]

ans = max(a,b,c)
if ans == 1:
    ans = -1
else:
    ans += 1
print(ans)

Submission status: Wrong Answer

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