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())
za = a
zb = b
zc = c

d = 0

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

while True:
    a = int(zb / 2) + int(zc / 2)
    b = int(za / 2) + int(zc / 2)
    c = int(za / 2) + int(zb / 2)

    za = a
    zb = b
    zc = c

    d += 1
    
    if a % 2 != 0 or b % 2 != 0 or b % 2 != 0:
        print(d)
        exit()

Submission status: Wrong Answer

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

d = 0

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

while True:
    a = int(zb / 2) + int(zc / 2)
    b = int(za / 2) + int(zc / 2)
    c = int(za / 2) + int(zb / 2)

    za = a
    zb = b
    zc = c

    d += 1
    print(a,b,c)

    if a % 2 != 0 or b % 2 != 0 or b % 2 != 0:
        print(d)
        exit()

Submission status: Wrong Answer

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

if A == B == C:
    print(-1)
else:
    c = 0
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        c += 1
        A2 = (B + C) // 2
        B2 = (A + C) // 2
        C2 = (A + B) // 2

        A = A2
        B = B2
        C = C2
    print(c)

Submission status: Wrong Answer

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


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

counter = 0
while True:
    counter += 1
    w_a = a / 2
    w_b = b / 2
    w_c = c / 2

    a = w_b + w_c
    b = w_a + w_c
    c = w_b + w_a

    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(counter)
        exit(0)

Submission status: Wrong Answer

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

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

counter = 0
while True:
    counter += 1
    w_a = a / 2
    w_b = b / 2
    w_c = c / 2

    a = w_b + w_c
    b = w_a + w_c
    c = w_b + w_a

    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(counter)
        exit(0)

Submission status: Wrong Answer

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

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

counter = 0
while True:
    counter += 1
    w_a = a / 2
    w_b = b / 2
    w_c = c / 2

    a = w_b + w_c
    b = w_a + w_c
    c = w_b + w_a

    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(counter)
        exit(0)

Submission status: Wrong Answer

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

for i in range(3):
    w_a = a / 2
    w_b = b / 2
    w_c = c / 2

    a = w_b + w_c
    b = w_a + w_c
    c = w_b + w_a

    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        print(i + 1)
        exit(0)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
def main():
    A,B,C = map(int,input().split())
    if A == B == C:
        print(-1)
    else:
        for i in range(10**8):
            if A%2 != 0 or B%2 != 0 or C%2 != 0:
                break
            else:
                ta,tb,tc = A,B,C
                A = (tb+tc)//2
                B = (ta+tc)//2
                C = (ta+tb)//2
        print(i)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    A,B,C = map(int,input().split())
    if A == B == C:
        print(-1)
    else:
        for i in range(10**8):
            if A%2 != 0 or B%2 != 0 or C%2 != 0:
                break
            else:
                ta,tb,tc = A,B,C
                A = (tb+tc)/2
                B = (ta+tc)/2
                C = (ta+tb)/2
        print(i)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    A,B,C = map(int,input().split())
    if A == B == C:
        print(-1)
    else:
        for i in range(10**6):
            if A%2 != 0 or B%2 != 0 or C%2 != 0:
                break
            else:
                ta,tb,tc = A,B,C
                A = (tb+tc)/2
                B = (ta+tc)/2
                C = (ta+tb)/2
        print(i)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

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


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

cnt = 0
while A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
    a = B // 2 + C // 2
    b = A // 2 + C // 2
    c = A // 2 + B // 2
    A = a
    B = b
    C = c
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys

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


# def is_power_of_two(x):
#     while (x % 2) == 0 and x > 1:
#         x = x // 2
#     res = x == 1
#     return res


# if is_power_of_two(A) and is_power_of_two(B) and is_power_of_two(C):
#     print(-1)
#     sys.exit()

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

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

cnt = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    a = B // 2 + C // 2
    b = A // 2 + C // 2
    c = A // 2 + B // 2
    A = a
    B = b
    C = c
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys

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


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

cnt = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    a = B // 2 + C // 2
    b = A // 2 + C // 2
    c = A // 2 + B // 2
    A = a
    B = b
    C = c
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys

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


def is_power_of_two(x):
    while (x % 2) == 0 and x > 1:
        x = x // 2
    res = x == 1
    return res


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

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

cnt = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    a = B // 2 + C // 2
    b = A // 2 + C // 2
    c = A // 2 + B // 2
    A = a
    B = b
    C = c
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
def check(aa,bb,cc):
    if aa%2==0 and bb%2==0 and cc%2==0:
        return True
    else:
        return False

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

ans = 0
while check(a,b,c):
    _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
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
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 operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

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

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

cnt=0
chk=True
while chk:
    a,b,c=b//2+c//2,a//2+c//2,b//2+a//2
    cnt+=1
    if a%2==0 and b%2==0 and c%2==0:
        pass
    else:
        chk=False

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
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 operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

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

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

cnt=0
chk=True
while chk:
    a,b,c=b//2+c//2,a//2+c//2,b//2+a//2
    cnt+=1
    if a%2==1 or b%2==1 or c%2==1:
        chk=False
    if a==b and a==c:
        print(-1)
        exit()
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
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 operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

a,b,c=mii()
if a==b and a==c:
    print("-1")
    exit()
cnt=0
chk=True
while chk:
    a,b,c=b//2+c//2,a//2+c//2,b//2+a//2
    cnt+=1
    if a%2==1 or b%2==1 or c%2==1:
        chk=False
    if a==b and a==c:
        print(-1)
        exit()
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
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 operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

a,b,c=mii()
if a==b and a==c:
    print("-1")
    exit()
cnt=0
chk=True
while chk:
    a,b,c=b//2+c//2,a//2+c//2,b//2+a//2
    cnt+=1
    if a%2==1 or b%2==1 or c%2==1:
        chk=False
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
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 operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

a,b,c=mii()
if a==b and a==c:
    print(-1)
    exit()
cnt=0
chk=True
while chk:
    a,b,c=b//2+c//2,a//2+c//2,b//2+a//2
    cnt+=1
    if a%2==1 or b%2==1 or c%2==1:
        chk=False
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
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 operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

a,b,c=mii()
if a==b==c:
    print(-1)
    exit()
cnt=0
chk=True
while chk:
    a,b,c=b//2+c//2,a//2+c//2,b//2+a//2
    cnt+=1
    if a%2==1 or b%2==1 or c%2==1:
        chk=False
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
a, b, c = [int(i) for i in sys.stdin.readline().split()]
if a == b == c:
    print(-1)
else:
    ls = np.array([a, b, c])
    arr = np.array([[0, 0.5, 0.5],
                    [0.5, 0, 0.5],
                    [0.5, 0.5, 0]])
    cnt = 0
    while sum(ls % 2) == 0:
        ls = ls.dot(arr)
        cnt += 1
    print(cnt)

Submission status: Wrong Answer

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

def main():
    A,B,C = map(int,input().split())
    if A == B == C:
        if A%2 == 0:
            print(-1)
        else:
            print(0)
    else:
        for i in range(10**5):
            if i == 10**5-10:
                print("-1")
                exit()
            _A,_B,_C = A,B,C
            A = (_B+_C)//2
            B = (_A+_C)//2
            C = (_A+_B)//2
            if (A%2 == 1 or B%2 == 1 or C%2 == 1):
                print(i+1)
                exit()
        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

def main():
    A,B,C = map(int,input().split())
    if A == B == C:
        if A%2 == 0:
            print(-1)
        else:
            print(0)
    else:
        for i in range(10**8):
            _A,_B,_C = A,B,C
            A = (_B+_C)//2
            B = (_A+_C)//2
            C = (_A+_B)//2
            if (A%2 == 1 or B%2 == 1 or C%2 == 1):
                print(i+1)
                exit()
        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

def main():
    A,B,C = map(int,input().split())
    if A == B == C:
        if A%2 == 0:
            print(-1)
        else:
            print(0)
    else:
        for i in range(10**3):
            _A,_B,_C = A,B,C
            A = (_B+_C)//2
            B = (_A+_C)//2
            C = (_A+_B)//2
            if (A%2 == 1 or B%2 == 1 or C%2 == 1):
                print(i+1)
                exit()
        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

def main():
    A,B,C = map(int,input().split())
    if A == B == C:
        print("-1")
    else:
        for i in range(10**3):
            _A,_B,_C = A,B,C
            A = (_B+_C)//2
            B = (_A+_C)//2
            C = (_A+_B)//2
            if (A%2 == 1 or B%2 == 1 or C%2 == 1):
                print(i+1)
                exit()
        
if __name__ == "__main__":
    main()

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 A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        a = A // 2
        b = B // 2
        c = C // 2
        A = b + c
        B = c + a
        C = a + b
        ans += 1
        if ans > 10**5:
            print(-1)
            exit()
    print(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 A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        a = A / 2
        b = B / 2
        c = C / 2
        A = b + c
        B = c + a
        C = a + b
        ans += 1
        if ans > 10**5:
            print(-1)
            exit()
    print(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 A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        a = A / 2
        b = B / 2
        c = C / 2
        A = b + c
        B = c + a
        C = a + b
        ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

cookies = np.array(lr())
if len(set(cookies)) == 1:
    print(-1)
    exit()
if any(cookies&1):
    print(0)
    exit()
count = 0
half_total = cookies.sum() // 2
while True:
    cookies = half_total - cookies//2
    count += 1
    if any(cookies&1):
        print(count)
        break
    if count == 1000000:
        print(-1)
        exit()

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

cookies = np.array(lr())
if len(set(cookies)) == 1:
    print(-1)
    exit()
if any(cookies&1):
    print(0)
    exit()
count = 0
half_total = cookies.sum() // 2
while True:
    cookies = half_total - cookies//2
    count += 1
    if any(cookies&1):
        print(count)
        break
    if count == 10000:
        print(-1)
        exit()

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

cookies = np.array(lr())
if len(set(cookies)) == 1:
    print(-1)
    exit()
if any(cookies&1):
    print(0)
    exit()
count = 0
half_total = cookies.sum() // 2
while True:
    cookies = half_total - cookies//2
    print(cookies)
    count += 1
    if any(cookies&1):
        print(count)
        break
    if count == 10000:
        print(-1)
        exit()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def roundUp(a, b):
        return -(-a // b)

    @staticmethod
    def toUpperMultiple(a, x):
        return Math.roundUp(a, x) * x

    @staticmethod
    def toLowerMultiple(a, x):
        return (a // x) * x

    @staticmethod
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

    @staticmethod
    def sign(n):
        if n == 0:
            return 0
        if n < 0:
            return -1
        return 1

    @staticmethod
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


class PriorityQueue:
    def __init__(self, l=[]):
        self.__q = l
        heapq.heapify(self.__q)
        return

    def push(self, n):
        heapq.heappush(self.__q, n)
        return

    def pop(self):
        return heapq.heappop(self.__q)


MOD = int(1e09) + 7
INF = int(1e15)


def main():
    # sys.stdin = open("sample.txt")
    A, B, C = Scanner.map_int()
    if A == B == C:
        print(-1)
        return
    ans = 0
    while A % 2 == B % 2 == C % 2 == 0:
        a, b, c = A//2, B//2, C//2
        A, B, C = b+c, c+a, a+b
        ans += 1
    print(ans)
    return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a == b and a == c:
	print(-1)
	exit()
	
ans = 0
s, t, u = 0, 0, 0
while a%2==0 and b%2==0 and c%2==0:
	s = b//2 + c//2
	t = a//2 + c//2
	u = a//2 + b//2
	a, b, c = s, t, u
	ans += 1
	
print(ans)

Submission status: Wrong Answer

Solution code:
l = list(map(int, input().split()))
cnt=1
while True:
    if l[0]==l[1]==l[2]:
        print(-1)
        exit()
    elif l[0]%2!=0 or l[1]%2!=0 or l[2]%2!=0:
        print(0)
        exit()
    a=(l[1]/2)+(l[2]/2)
    b=(l[0]/2)+(l[2]/2)
    c=(l[0]/2)+(l[1]/2)
    if a%2==0 and b%2==0 and c%2==0:
        l.clear()
        l.append(a)
        l.append(b)
        l.append(c)
        cnt+=1
    else:
        print(cnt)
        exit()

Submission status: Wrong Answer

Solution code:
l = list(map(int, input().split()))
cnt=0
while True:
    if l[0]==l[1]==l[2]:
        print(-1)
        exit()
    a=(l[1]/2)+(l[2]/2)
    b=(l[0]/2)+(l[2]/2)
    c=(l[0]/2)+(l[1]/2)
    if a%2==0 and b%2==0 and c%2==0:
        l.clear()
        l.append(a)
        l.append(b)
        l.append(c)
        cnt+=1
    else:
        print(cnt+1)
        exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin

a,b,c = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
num = 0

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

while True:
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
        print(count)
        exit()
    else:
        a,b,c = b//2+c//2,c//2+a//2,a//2+b//2
        count += 1
    num += 1

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
count=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,B//2+C//2
    count+=1
print(count)

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==b%2==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())
cnt=0
if a==b==c or a%2==b%2==c%2==1:
  print(-1)
  exit()
while a%2==b%2==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())
cnt=0
if a==b==c:
  print(-1)
  exit()
while a%2==b%2==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:
import sys
sys.setrecursionlimit(10**9)

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

if a == b == c:
	print(-1)
	sys.exit()
cnt = 0
while True:
	if a%2==1 or b%2==1 or c%2==1:
		break
	a,b,c = (b+c)//2,(a+c)//2,(b+c)//2
	cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
cnt=0
while True:
    if A==B==C:
        cnt-=1
        break
    elif A%2==B%2==C%2==0:
        hA=A//2
        hB=B//2
        hC=C//2
        A=hB+hC
        B=hA+hC
        C=hA+hB
        cnt+=1
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

def main():
	A = MAP()
	if A[0] == A[1] and A[0] == A[2]:
		print(-1)
	else:
		cnt = 0
		while all(a%2 == 0 for a in A):
			a = A[0]//2 + A[1]//2
			b = A[1]//2 + A[2]//2
			c = A[0]//2 + A[2]//2
			A[0] = a
			A[1] = b
			A[2] = c
			cnt += 1
			# A.sort()
			# print(A)

		print(cnt)

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

if a == b == c:
    print(-1)
else:
    while True:
        a = (total - a)/2
        b = (total - b) /2
        c = (total - c) /2
        
        if a.is_integer() and b.is_integer() and c.is_integer():
            ct += 1
        else:
            break
        
    print(ct)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
A, B, C = map(int, input().split(' '))

ans = 0
while True:
    A, B, C = B // 2 + C // 2, A // 2 + C // 2, A // 2 + B // 2
    ans += 1

    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        break

    if ans > 50:
        ans = -1
        break
    # print(A, B, C)

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
A, B, C = map(int, input().split(' '))

def log_2(n):
    ret = 0
    while n != 0:
        if n % 2 == 1:
            break
        else:
            n /=  2
            ret += 1
    return ret

a, b, c = log_2(A), log_2(B), log_2(C)
# print(a, b, c)

if 2 ** a == A and 2 ** b == B and 2 ** c == C:
    print(-1)

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

else:
    ans = 0
    # シュミレーション
    while True:
        A, B, C = B//2 + C//2, A//2 + C//2, A//2 + B//2
        ans += 1

        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            break

        # print(A, B, C)

    print(ans)

Submission status: Wrong Answer

Solution code:
from fractions import gcd
a,b,c=map(int,input().split())
if a%2 or b%2 or c%2:
  print(0)
  exit()
if a==b==c:
  print(-1)
  exit()
x=abs(a-b)
y=abs(b-c)
z=abs(c-a)
t=gcd(gcd(x,y),z)
for i in range(1,100):
  if t%2:
    print(i+1)
    break
  else:
    t=t//2

Submission status: Wrong Answer

Solution code:
from fractions import gcd
a,b,c=map(int,input().split())
if a%2 or b%2 or c%2:
  print(0)
  exit()
if a==b==c:
  print(-1)
  exit()
x=abs(a-b)
y=abs(b-c)
z=abs(c-a)
t=gcd(gcd(x,y),z)
for i in range(1,100):
  if t%2:
    print(i)
    break
  else:
    t=t//2

Submission status: Wrong Answer

Solution code:
from fractions import gcd
a,b,c=map(int,input().split())
if a%2 or b%2 or c%2:
  print(0)
  exit()
x=abs(a-b)
y=abs(b-c)
z=abs(c-a)
t=gcd(gcd(x,y),z)
for i in range(1,100):
  if t%2:
    print(i-1)
    break
  else:
    t=t//2

Submission status: Wrong Answer

Solution code:
from fractions import gcd
a,b,c=map(int,input().split())
if a%2 or b%2 or c%2:
  print(0)
  exit()
x=abs(a-b)
y=abs(b-c)
z=abs(c-a)
t=gcd(gcd(x,y),z)
for i in range(1,100):
  if t%2:
    print(i)
    break
  else:
    t=t//2

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
ret = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0 :
  A, B, C = B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2
  ret += 1
  if A == B == C :
    break

if A == B == C :
  print(-1)
else :
  print(ret)