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())
cou = 0
if a==b and b==c and c==a :
  print(-1)
  exit()
while a%2==0 and b%2==0 and c%2==0:
  j=int(a//2)
  k=int(b//2)
  m=int(c//2)
  a += k+m
  b += j+m
  c += j+k
  cou += 1
print(cou)

Submission status: Wrong Answer

Solution code:
a, b, c = list(map(int, input().split()))
if a == b == c:
    print(-1)
    exit()
count = 0
while True:
    if sum([a % 2, b % 2, c % 2]) > 0:
        print(count)
        exit()
    else:
        a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
        count += 1

Submission status: Wrong Answer

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

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

while True:
    if A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        t_A, t_B, t_C = A, B, C
        A = (t_B + t_C) // 2
        B = (t_C + t_A) // 2
        C = (t_A + t_B) // 2
        ans += 1
    else:
        print(ans)
        break

Submission status: Wrong Answer

Solution code:
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


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

Submission status: Wrong Answer

Solution code:
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


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

Submission status: Wrong Answer

Solution code:
import copy
a,b,c = map(int,input().split())
cnt = 0
if (a % 2 == 1) or (b % 2 == 1) or (c % 2 == 1):
    print(1)
    exit()
while 1:
    cnt += 1 
    next_a = b // 2 +  c // 2
    next_b = a // 2 + c // 2
    next_c = a // 2 + b // 2
    if a == next_a and b == next_b and c == next_c:
        print(-1)
        break
    elif (next_a % 2 == 1) or (next_b % 2 == 1) or (next_c % 2 == 1):
        print(cnt)
        break
    a = copy.deepcopy(next_a)
    b = copy.deepcopy(next_b)
    c = copy.deepcopy(next_c)

Submission status: Wrong Answer

Solution code:
import copy
a,b,c = map(int,input().split())
cnt = 0
while 1:
    cnt += 1 
    next_a = b // 2 +  c // 2
    next_b = a // 2 + c // 2
    next_c = a // 2 + b // 2
    if a == next_a and b == next_b and c == next_c:
        print(-1)
        break
    elif (next_a % 2 == 1) or (next_b % 2 == 1) or (next_c % 2 == 1):
        print(cnt)
        break
    a = copy.deepcopy(next_a)
    b = copy.deepcopy(next_b)
    c = copy.deepcopy(next_c)

Submission status: Wrong Answer

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

for i in range(c):
    if int(a/2)*2==a and int(b/2)*2==b and int(c/2)*2==c:
        ans += 1
        x = b / 2 + c / 2
        y = a / 2 + c / 2
        z = b / 2 + a / 2
        a = x
        b = y
        c = z
        if a == b and b == c:
            break
    else:
        p = 1
        print(ans)
        break

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def f(x):
    res = 0
    while(x%2==0):
        res += 1
        x //= 2
    return res
def main():
    A,B,C=MI()
    if(A==B==C):
        print(-1)
    else:
        L=[f(A+B),f(B+C),f(C+A),f(A+A),f(B+B),f(C+C)]
        print(min(L))
        

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def f(x):
    res = 0
    while(x%2==0):
        res += 1
        x //= 2
    return res
def main():
    A,B,C=MI()
    if(A==B==C):
        print(-1)
    else:
        L=[f(A+B),f(B+C),f(C+A)]
        print(min(L))
        

if __name__ == '__main__':
    main()

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 a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        _a = (b+c)//2
        _b = (c+a)//2
        _c = (a+b)//2
        a = _a
        b = _b
        c = _c
        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(10**8):
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        break
    a_o,b_o,c_o = a,b,c
    a = b_o//2 + c_o//2
    b = a_o//2 + c_o//2
    c = a_o//2 + b_o//2
print(i)

Submission status: Wrong Answer

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

if A==B==C:
  print(-1)
else:
  ans = 0
  while 1:
    if A%2==1 or B%2==1 or C%2 ==1:
      print(ans)
      break
    tempA = A//2
    tempB = B//2
    A = tempB + C//2
    B = tempA + C//2
    C = tempA + tempB
    ans+=1

Submission status: Wrong Answer

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    A, B, C = readnums()
    if A == B and B == C:
        print(-1)
    else:
        ans = 0
        while all([not A % 2, not B % 2, not C % 2]):
            A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2
            ans += 1

        print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
cookie = list(map(int, input().split()))
sc = sum(cookie)
cnt = -1
if cookie[0] == cookie[1] and cookie[1] == cookie[2] and cookie[0]%2 == 0:
    print(-1)
    exit()
memo = [0]*3
while cookie[0]%2 == 0 and cookie[1]%2 == 0 and cookie[2]%2 == 0:
    memo[0] = (cookie[1] + cookie[2]) // 2
    memo[1] = (cookie[0] + cookie[2]) // 2
    memo[2] = (cookie[1] + cookie[0]) // 2
    for i in range(3):
        cookie[i] = memo[i]
    cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
cookie = list(map(int, input().split()))
sc = sum(cookie)
cnt = -1
if cookie[0] == cookie[1] and cookie[1] == cookie[2]:
    print(cnt)
    exit()
memo = [0]*3
while sum(cookie) == sc:
    memo[0] = (cookie[1] + cookie[2]) // 2
    memo[1] = (cookie[0] + cookie[2]) // 2
    memo[2] = (cookie[1] + cookie[0]) // 2
    for i in range(3):
        cookie[i] = memo[i]
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

if a == b and b == c and c == a:
    print(-1)
else:
    for i in range(10**9):
        ans = i
        if a % 2 ==1:
            break
        else:
            tmpa = b/2 + c/2
        if b % 2 == 1:
            break
        else:
            tmpb = c/2 + a/2
        if c % 2 == 1:
            break
        else:
            tmpc = a/2 + b/2
        a = tmpa
        b = tmpb
        c = tmpc
    print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
cou = 0
if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
  print("0")
while(cou < 10**6):
  cou += 1
  a = A
  b = B
  c = C
  A = b/2 + c/2
  B = a/2 + c/2
  C = a/2 + b/2
  if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
    print(str(cou))
    exit()
  else:
    pass
print("-1")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
cou = 0
if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
  print("0")
while(cou < 10*7):
  cou += 1
  a = A
  b = B
  c = C
  A = b/2 + c/2
  B = a/2 + c/2
  C = a/2 + b/2
  if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
    print(str(cou))
    exit()
  else:
    pass
print("-1")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
cou = 0
if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
  print("0")
while(cou < 10*7):
  cou += 1
  A = B/2 + C/2
  B = A/2 + C/2
  C = A/2 + B/2
  if(A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
    print(str(cou))
    break
  else:
    pass
print("-1")

Submission status: Wrong Answer

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

a0, b0, c0 = a, b, c
a1, b1, c1 = 0, 0, 0

cnt = 0
while True:
    a1 = b0/2 + c0/2
    b1 = a0/2 + c0/2
    c1 = a0/2 + c0/2

    a0 = a1
    b0 = b1
    c0 = c1

    cnt += 1

    if a1%2==1 or b1%2==1 or c1%2==1:
        print(cnt)
        exit()

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

Submission status: Wrong Answer

Solution code:
import math
from collections import deque
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b,c = readInts()
ans=0

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

while not a%2+b%2+c%2:
	ta = a
	tb = b
	tc = c
	a = (b+c)//2
	b = (ta+tc)//2
	c = (ta+tb)//2
	#print(a,b,c)
	ans+=1

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

Submission status: Wrong Answer

Solution code:
import math
from collections import deque
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b,c = readInts()
ans=0

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

while not a%2+b%2+c%2:
	ta = a
	tb = b
	tc = c
	a = (b+c)//2
	b = (ta+tc)//2
	c = (ta+tb)//2
	#print(a,b,c)
	ans+=1

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

Submission status: Wrong Answer

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

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

C = 1
while 1:
    a, b, c = b//2 + c//2 , a//2 + c//2 , b//2 + a//2
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
        print(C)
        sys.exit()
    else:
        C += 1

Submission status: Wrong Answer

Solution code:
import sys
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C = LI()
ans = 0
if A == B == C and A%2==0:
    print(-1)
    sys.exit()

    while True:
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            break
        a = B / 2 + C / 2
        b = A / 2 + C / 2
        c = A / 2 + B / 2
        A = a
        B = b
        C = c
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C = LI()
ans = 0
if A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    if A == B == C:
        print(-1)

    else:
        while True:
            if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
                break
            a = B / 2 + C / 2
            b = A / 2 + C / 2
            c = A / 2 + B / 2
            A = a
            B = b
            C = c
            ans += 1

    print(ans)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C = LI()
ans = 0
if A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
    if A == B == C:
        print(-1)

    else:
        while True:
            if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
                break
            a = B / 2 + C / 2
            b = A / 2 + C / 2
            c = A / 2 + B / 2
            A = a
            B = b
            C = c
            ans += 1

    print(ans)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

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

    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C = LI()
ans = 0
if A == B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    print(-1)
else:
    while True:
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            break
        a = B / 2 + C / 2
        b = A / 2 + C / 2
        c = A / 2 + B / 2
        A = a
        B = b
        C = c
        print(A,B,C)
        ans += 1

    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

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

    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C = LI()
ans = 0
if A == B == C:
    print(-1)
else:
    while True:
        if A % 2 != 0 or B % 2 != 0 or C % 2 != 0:
            break
        a = B / 2 + C / 2
        b = A / 2 + C / 2
        c = A / 2 + C / 2
        A = a
        B = b
        C = c
        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:
  count = 0
  while True:
    count+=1
    A_tmp = B/2 + C/2
    B_tmp = A/2 + C/2
    C = A/2 + B/2
    A = A_tmp
    B = B_tmp
    if A%2==1 or B%2==1 or C%2==1:
      break
  print(count)

Submission status: Wrong Answer

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

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

count = 0
while all([a % 2 == 0, b % 2 == 0, 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:
a, b, c = map(int, input().split())
ans = 0
if a == b == c:
    print(-1)
else:
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        total = a + b + c
        a = (total - a) / 2
        b = (total - b) / 2
        c = (total - c) / 2
        ans += 1
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

count = 0
S = 0
T = 0
U = 0

if(A == B == C):
  print("-1")
  
else:
  while(A % 2 == 0 and B % 2 == 0 and C % 2 == 0):
    count+= 1
    S = 1/2 * A
    T = 1/2 * B
    U = 1/2 * C
    A = T + U 
    B = S + T 
    C = S + U 
  print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

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

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

count = 0
while True:
    a = B//2 + C//2
    b = C//2 + A//2
    c = A//2 + B//2
    count += 1
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    if (a == b and b == c) or count > 31:
        print('-1')
        sys.exit()
    A = a
    B = b
    C = c

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

count = 0
while True:
    a = B//2 + C//2
    b = C//2 + A//2
    c = A//2 + B//2
    count += 1
    if (a == b and b == c) or count > 31:
        print('-1')
        sys.exit()
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    A = a
    B = b
    C = c

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

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

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

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

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

count = 0
while True:
    a = (A+B)/2
    b = (C+A)/2
    c = (A+B)/2
    count += 1
    if (a == b and b == c) or count > 31:
        print('-1')
        sys.exit()
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    A = a
    B = b
    C = c

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

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

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

count = 0
while True:
    a = B//2 + C//2
    b = C//2 + A//2
    c = A//2 + B//2
    count += 1
    if (a == b and b == c) or (a % 4 == 0 and b % 4 == 0 and c % 4 == 0):
        print('-1')
        sys.exit()
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    A = a
    B = b
    C = c

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

count = 0
while True:
    a = B//2 + C//2
    b = C//2 + A//2
    c = A//2 + B//2
    count += 1
    if (A == B and B == C) or (A % 4 == 0 and B % 4 == 0 and C % 4 == 0):
        print('-1')
        sys.exit()
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    A = a
    B = b
    C = c

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

count = 0
while True:
    a = B//2 + C//2
    b = C//2 + A//2
    c = A//2 + B//2
    count += 1
    if (A == B and B == C) or (count > 10**9):
        print('-1')
        sys.exit()
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    A = a
    B = b
    C = c

print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

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

print(count)

Submission status: Wrong Answer

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

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

print(count)