TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
import math
n = list(map(int, input().split()))
d = max(m)-min(m)
if d:
  cnt = 0
  while d%2 == 0:
    d //= 2
    cnt += 1
  print(cnt)
elif n[0]%2:
  print(0)
else:
  print(-1)

import math
n = list(map(int, input().split()))
d = max(n)-min(n)
if d:
  cnt = 0
  while d%2 == 0:
    d //= 2
    cnt += 1
  print(cnt)
elif n[0]%2:
  print(0)
else:
  print(-1)


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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b,c = map(int,input().split())
cnt = 0

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

while acnt%2 == 0 and bcnt%2 == 0 and ccnt%2 == 0:
    cnt+=1
    i=a
    j=b
    a=(b+c)//2
    b=(i+c)//2
    c=(i+j)//2

print(cnt)

a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0
if a == b and a== c and a%2 == 0:
    print(-1)
    exit()
while a%2 == 0 and b%2 == 0 and c%2 == 0:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt
print(cnt)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A, B, C = map(int, input().split())
print(-1)

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


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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b,c=map(int,input().split())

if a%2==1 or b%2==1 or c%2==1:
  print(0)
elif a==b==c:
  print(-1)
else:
  cnt=0
  d=a
  e=b
  f=c
  while d%2==0 and e%2==0 and f%2==0:
    d=(e+f)/2
    e=(f+d)/2
    f=(d+e)/2
    cnt+=1 
  print(cnt)

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
n=int(input())
if n==1:
    print(1)
    sys.exit()
k=2
ans=0
while k*2<=n:
    k*=2
    ans+=1
print(k)

import sys
a,b,c=map(int,input().split())
ans=0
if a%2==1 or b%2==1 or c%2==1:
    print(0)
    sys.exit()
if a%2==0 and a==b==c:
    print(-1)
    sys.exit()
while a%2==0 and b%2==0 and c%2==0:
    ta=a/2
    tb=b/2
    tc=c/2
    a=tb+tc
    b=ta+tc
    c=ta+tb
    ans+=1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A,B,C = map(int,input().split())
ans = None

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


A,B,C = int(input())
ans = None

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

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

if not (A % 2 == 0 and B % 2 == 0 and C % 2 == 0):
  print(0)
  exit()

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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A,B,C=map(int,input().split())
if A==B==C:
    print(-1)
else:
    count=0
    while A%2==B%2==C%2==0:
        A=(B+C)/2
        B=(C+A)/2
        C=(A+B)/2
        count+=1
    print(count)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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()


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 any(cookies&1):
    print(0)
    exit()
if len(set(cookies)) == 1:
    print(-1)
    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()


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def mapint_inp():
    return map(int, input().split())

A, B, C = mapint_inp()

print(-1)

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

A, B, C = mapint_inp()

ans = 0
while(1):
    if A%2==1 or B%2==1 or C%2==1:
        break
    if A == B and B == C:
        ans = -1
        break
    halvedA = A//2
    halvedB = B//2
    halvedC = C//2
    A = halvedB+halvedC
    B = halvedA+halvedC
    C = halvedA+halvedB
    ans+=1

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A, B, C = list(map(int, input().split()))

pattern = list()
i = 0
while True:
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        print(i)
        break
    if (A, B, C) in pattern:
        print(-1)
        break
    tmp_A = A
    tmp_B = B
    A = (B + C) / 2
    B = (C + tmp_A) / 2
    C = (tmp_B + tmp_A) / 2

    i += 1

    pattern.append((A, B, C))



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

pattern = list()
i = 0
while True:
    if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
        print(i)
        break
    tmp_A = A
    tmp_B = B
    A = (B + C) / 2
    B = (C + tmp_A) / 2
    C = (tmp_B + tmp_A) / 2

    i += 1

    if (A, B, C) in pattern:
        print(-1)
        break
    pattern.append((A, B, C))



Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def abc(a, b, c):
    ans = -1
    v = a%2 + b%2 + c%2
    while v==0:
        ans += 1
        v = a%2 + b%2 + c%2
        x, y, z = a, b, c
        a = y//2 + z//2
        b = z//2 + x//2
        c = x//2 + y//2
        print('{} {} {}'.format(a, b, c))
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))

if __name__=='__main__':
    main()

def abc(a, b, c):
    ans = -1
    v = a%2 + b%2 + c%2
    while v==0:
        ans += 1
        v = a%2 + b%2 + c%2
        x, y, z = a, b, c
        a = (y+z)/2
        b = (z+x)/2
        c = (x+y)/2
    return ans

def main():
    a, b, c = map(int, input().split())
    if a==b and b==c:
        print(-1)
    else:
        print(abc(a,b,c))

def abc(a, b, c):
    ans = 0
    while a%2 + b%2 + c%2==0:
        if a==b and b==c:
            ans = -1
            break
        ans += 1
        x, y, z = a, b, c
        a = (y+z)//2
        b = (z+x)//2
        c = (x+y)//2
    return ans

def main():
    a, b, c = map(int, input().split())
    print(abc(a,b,c))
if __name__=='__main__':
    main()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
cookie = input('三人のクッキー枚数は？').split()
A,B,C = int(cookie[0]),int(cookie[1]),int(cookie[2])
kaisuu = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    A,B,C = (B+C)/2,(A+C)/2,(A+B)/2
    if A == B and B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        kaisuu = -1
        break
    else:
        kaisuu += 1
print(kaisuu)

cookie = input().split()
A,B,C = int(cookie[0]),int(cookie[1]),int(cookie[2])
kaisuu = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    A,B,C = (B+C)/2,(A+C)/2,(A+B)/2
    if A == B and B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        kaisuu = -1
        break
    else:
        kaisuu += 1
print(kaisuu)

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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

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

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b,c=map(int,input().split())
if a%2==1 or b%2==1 or c%2==1:
  print(0)
else:
  if a==b and b==c:
    print(-1)
  else:
    cnt=0
    flag=0
    while flag==0:
      if a%2==1 or b%2==1 or c%2==1:
        flag=1
        break
      a//=2
      b//=2
      c//=2
      cnt+=1
    print(cnt)

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)

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,b,c=b//2+c//2,a//2+c//2,b//2+a//2
    ans+=1
  print(ans)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b, c = [int(x) for x in input().strip().split()]

def f(a, b, c, count):
    if a // 2 % 2 == 1 and b // 2 % 2 == 1 and c // 2 % 2 == 1:
        count += 1
        return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
    elif a // 2 % 2 == 0 and b // 2 % 2 == 0 and c // 2 % 2 == 0:
        count += 1
        return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
    else:
        return count

if a == b and b == c:
    print(-1)
else:
    print(f(a, b, c, 0))

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

def f(a, b, c, count):
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        count += 1
        return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
    else:
        return count

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b,c=map(int,input().split())
d=0
if a==b==c and a%2==0:
    print(-1)
else:
    while a%2==0 and b%2==0 and c%2==0:
        a,b,c=(b+c),(a+c),(a+b)
        d+=1
print(d)

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A,B,C = map(int,input().split())

if A == B == C:
  print(-1)
else:
  c = 0
  while A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
    A = B//2 + C//2
    B = A//2 + C//2
    C = B//2 + C//2
    c+=1
  print(c)

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

if A == B == C: 
  print(-1 if A%2==0 else 0)
else:
  c = 0
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    ba = A
    bb = B
    bc = C
    A = (bb + bc)//2
    B = (ba + bc)//2
    C = (ba + bb)//2
    c+=1
  print(c)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A,B,C = list(map(int,input().split()))

if A == B and A == C:
  print(-1)
  exit(
else:
  cnt = 0
  while True:
    if A%2==0 and B%2==0 and C%2==0:
      A,B,C = (B+C)//2,(A+C)//2,(A+B)//2
      cnt += 1
      continue
    else:
      break
      
print(cnt)

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

if A == B and A == C:
  if A%2==0:
    print(-1)
  else:
    print(0)
  exit()
else:
  cnt = 0
  while True:
    if A%2==0 and B%2==0 and C%2==0:
      A,B,C = (B+C)//2,(A+C)//2,(A+B)//2
      cnt += 1
      continue
    else:
      break
      
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import sys

N,M=list(map(int, input().split()))
p=[]
q=0
count=0
for i in range(0,M):
  p.append(list(map(int, input().split())))
for i in range(0,M):
  q+=p[i][0]-p[i][1]
if q%2==1:
  print("NO")
else:
  m=int(M/100)
  for j in range(0,M,m):
    for i in range(0,M):
      if p[i][0]==j or p[i][1]==j:
        count+=1
    if count%2==1:
      print("NO")
      sys.exit()
  else: 
    print("YES")

# -*- coding: utf-8 -*-
import sys

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

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b,c = map(int,input().split())
lst = [a,b,c]
lst.sort()
res = True
if a==b-=c:
    print(-1)
else:
    while True:
        if a%2!=0 or b%2!=0 or c%2!=0:
            break
        else:
            res += 1
            nx_a = b//2 + c//2
            nx_b = a//2 + c//2
            nx_c = a//2 + b//2
            tmp = [nx_a, nx_b, nx_c]
            tmp.sort()
            if lst==tmp:
                print(-1)
                exit()
            a,b,c = nx_a, nx_b, nx_c
    print(res)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import copy
temp=input().split()
A=int(temp[0])
B=int(temp[1])
C=int(temp[2])

setT=[A,B,C]
setT.sort()
allSet=[]
allSet.append(setT)
ans=0
def distribute(x,y,z):
	temp=[y+z,z+x,x+y]
	for i in range(len(temp)):
		if temp[i]%2==0:
			temp[i]/=2
		else:
			return [0]
	return temp

setNext=distribute(A,B,C)
while len(setNext)==3:
	print(setNext)
	ans+=1
	setT=copy.deepcopy(setNext)
	setNext=distribute(setT[0],setT[1],setT[2])
	setNext.sort()
	if setNext in allSet:
		ans=-1
		break
	else:
		allSet.append(setNext)
print(ans)

import copy
temp=input().split()
A=int(temp[0])
B=int(temp[1])
C=int(temp[2])

setT=[A,B,C]
setT.sort()
allSet=[]
allSet.append(setT)
ans=0
def distribute(x,y,z):
	temp=[y+z,z+x,x+y]
	for i in range(len(temp)):
		if temp[i]%4==0:
			temp[i]/=2
		else:
			return [0]
	return temp

setNext=copy.deepcopy(setT)
for i in setT:
	if i%2==1:
		break
else:
	setNext=distribute(setT[0],setT[1],setT[2])
	ans+=1
	while len(setNext)==3:
		#print(setNext)
		ans+=1
		setT=copy.deepcopy(setNext)
		setNext=distribute(setT[0],setT[1],setT[2])
		setNext.sort()
		if setNext in allSet:
			ans=-1
			break
		else:
			allSet.append(setNext)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def solve(A, B, C):
    if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1):
        return 1
    elif (A == B == C):
        return -1
    else:
        return solve((B/2 + C/2), (A/2 + C/2), (A/2 + B/2)) + 1 

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




def solve(A, B, C):
    
    if (A % 2 == 1 or B % 2 == 1 or C % 2 == 1): return 0
    
    elif (A == B == C): return -1
    
    else: return solve((B/2 + C/2), (A/2 + C/2), (A/2 + B/2)) + 1

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def cookies_exchanges(a, b, c):
    counter = 0
    if a is b is c:
        return -1
    while int(a%2) is 0 and int(b%2) is 0 and int(c%2) is 0:
        o_a, o_b, o_c = a ,b ,c
        a = o_b/2 + o_c/2
        b = o_a/2 + o_c/2
        c = o_a/2 + o_b/2
        counter += 1

    return counter

a, b, c = map(int, input().split())
# print(cookies_exchanges(454, 414, 444))

def cookies_exchanges(a, b, c):
    counter = 0

    olds = []
    while int(a%2) is 0 and int(b%2) is 0 and int(c%2) is 0:
        if (a, b, c) in olds:
            return -1

        olds.append((a,b,c))
        o_a, o_b, o_c = olds[counter]
        a = o_b/2 + o_c/2
        b = o_a/2 + o_c/2
        c = o_a/2 + o_b/2
        counter += 1

    return counter

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A,B,C = map(int, input().split())

def even(a):
	if a % 2 == 0:
		return True
	else:
		return False

if A == B and B == C:
	print("-1")
elif:
	if not (even(A) and even(B) and even(C)):
		print("0")
		
else:
	cnt = 0
	while even(A) and even(B) and even(C):
		tmp1, tmp2, tmp3 = A,B,C
		A = (tmp2+tmp3) // 2
		B = (tmp3+tmp1) // 2
		C = (tmp1+tmp2) // 2
		cnt += 1
	print(cnt)


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

def even(a):
	if a % 2 == 0:
		return True
	else:
		return False

cnt = 0

while even(A) and even(B) and even(C):
	if A == B and B == C:
		cnt = -1
		break
	else:
		tmp1, tmp2, tmp3 = A,B,C
		A = (tmp2+tmp3) // 2
		B = (tmp3+tmp1) // 2
		C = (tmp1+tmp2) // 2
		cnt += 1

print(cnt)



Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b,c=map(int,input().split())
if a==b and b==c:
    print(-1)
elif if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(200000):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-1
    print(ans)

a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(2*10**5):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-1
    print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
print(0)

a,b,c=map(int,input().split())
e=a-b|b-c
print(len(f'{e&-e:b}')-(e==b&1))

a,b,c=map(int,input().split())
e=a-b|b-c
print((e^b&1)*(e^e-1).bit_length()-1)

a,b,c=map(int,input().split())
e=a-b|c-b
print(len(bin(e&-e))-3or~c%-2)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

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

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b, c = map(int(input().split()))
ans = 0

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


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

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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()


a, b, c = map(int, input().split())
za = 0
zb = 0
zc = 0

d = 0

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


while a % 2 == 0 and b % 2 == 0 and b % 2 == 0:

    za = a
    zb = b
    zc = c

    a = zb // 2 + zc // 2
    b = za // 2 + zc // 2
    c = za // 2 + zb // 2

    d += 1

print(d)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s=list(input().split())
n=int(input())
t=[input() for i in range(n)]
r=[]
for x in s:
    for y in t:
        if len(x)==len(y):
            l=list(x)
            for z in range(len(x)):
                if y[z]=="*":l[z]="*"
            if "".join(l)==y:
                r.append("*"*len(x))
                break
    else:r.append(x)
print(*r)

a,b,c=map(int,input().split())
d=0
while a%2==0 and b%2==0 and c%2==0:
    if a==b==c:
        print(-1)
        break
    d+=1
    ha=a//2
    hb=b//2
    hc=c//2
    a=hb+hc
    b=ha+hc
    c=ha+hb
else:print(d)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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()


a, b, c = map(int, input().split())
if a == b == c:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    cnt = 0
    while True:
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            ab = a // 2 + b // 2
            bc = b // 2 + c // 2
            ac = a // 2 + c // 2
            a = bc
            b = ac
            c = ab
            cnt += 1
        else:
            print(cnt)
            exit()


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
import sys

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

cnt = 0
while(True):
    half_a, half_b, half_c = a / 2, b / 2, c / 2
    ea = half_a % 2 == 0
    eb = half_b % 2 == 0
    ec = half_c % 2 == 0
    if (ea and eb and ec or (not ea) and (not eb) and (not ec)):
        cnt += 1
        a = half_b + half_c
        b = half_a + half_c
        c = half_a + half_b
    else:
        break

print(cnt)


import math
import sys

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

cnt = 0
while(True):
    half_a, half_b, half_c = a / 2, b / 2, c / 2
    ea = a % 2 == 0
    eb = b % 2 == 0
    ec = c % 2 == 0
    if (ea and eb and ec or (not ea) and (not eb) and (not ec)):
        cnt += 1
        a = half_b + half_c
        b = half_a + half_c
        c = half_a + half_b
    else:
        break

print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
from collections import deque
from math import ceil

def dist(h,w,x,y):
    return min(x-1,h-x,y-1,w-y)

h,w,k=map(int,input().split())
MAP=[]
A=['#']*(w+2)
MAP.append(A)
for i in range(h):
    s='#'+input().strip()+'#'
    for j,t in enumerate(s):
        if t=='S':
            sx,sy=i+1,j
    MAP.append(list(s))
MAP.append(A)
delta=[[1,0],[0,1],[-1,0],[0,-1]]
P=[]
Visited=[[False]*(w+2) for _ in range(h+2)]
Visited[sx][sy]=True
q=deque()
q.append((sx,sy,k))
while q:
    x,y,t=q.popleft()
    if t<0:
        break
    P.append([x,y])
    t-=1
    for dx,dy in delta:
        if MAP[y+dy][x+dx]=='.' and not Visited[x+dx][y+dy]:
            q.append((y+dy,x+dx,t))
            Visited[x+dx][y+dy]=True
ans=float('inf')
for x,y in P:
    ans=min(ans,1+ceil(dist(h,w,x,y)/k))
print(ans)

a,b,c=map(int,input().split())
if a==b==c:
    print(-int(not a%2))
else:
    cnt=0
    while not (a%2 or b%2 or c%2):
        cnt+=1
        a,b,c=(b+c)//2,(c+a)//2,(a+b)//2
    print(cnt)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#ABC014-A
abc = list(map(int,input().split()))

cnt = 0

while True:
    prev = abc[:]
    tmp = [abc[0]//2,abc[1]//2,abc[2]//2]
    cnt += 1
    abc = [tmp[1]+tmp[2],tmp[0]+tmp[2],tmp[0]+tmp[1]]
    
    if abc[0] == prev[0] and abc[1] == prev[1] and abc[2] == prev[2]:
        cnt = -1
        break
    elif abc[0] % 2 == 0 and abc[1] % 2 == 0 and abc[2] % 2  == 0:
        print(*abc)
        
    else:
        break
        
    
        
print(cnt)

#ABC014-A
abc = list(map(int,input().split()))

cnt = 0

while True:
    prev = abc[:]
    if abc[0] % 2 == 1 or abc[1] % 2 == 1 or abc[2] % 2 == 1:
        break
    tmp = [abc[0]//2,abc[1]//2,abc[2]//2]

    abc = [tmp[1]+tmp[2],tmp[0]+tmp[2],tmp[0]+tmp[1]]
    cnt += 1
    

        
    if abc[0] == prev[0] and abc[1] == prev[1] and abc[2] == prev[2]:
        cnt = -1
        break
    else:
        continue
        
    
        
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = input()
b = int(a)

s = (9-len(a))*'0'+a
ans = 0
for i in range(9):
    if s[i] == '0' and ans==0:
        continue
    ans+=(b//((10**(8-i))*10))*(10**(8-i))
    c = (b%((10**(8-i))*10))+1
    #print(0,c)
    if 2*(10**(8-i))>= c > 10**(8-i):
        ans+=c-10**(8-i)
    elif c>=2*10**((8-i)):
        ans+=10**(8-i)
    #print(ans)
print(ans)


a = lma()
f = 1
c =0
while f:
    if (a[0] == a[1] and a[0] == a[2]) :
        c=-1
        break
    if a[0]%2==1 or a[1]%2==1 or a[2]%2 ==1:break
    a[0],a[1],a[2] = (a[1]+a[2])/2,(a[0]+a[2])/2,(a[1]+a[0])/2
    c+=1
print(c)


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)


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

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)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b,c=map(int,input().split())
if a==b==c:
    print(-1)
else:
    while True:
        total=0
        x=a/2
        y=b/2
        z=c/2
        a=y+z
        b=x+z
        c=x+y
        total+=1
        if a%2!=0 or b%2!=0 or c%2!=0:
            print(total)
            break

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
l=list(map(int,input().split()))

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

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


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

for i in range(3):
    if l[i]%2==1:
        print(0)
        exit()

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

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



Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a, b, c = map(int, input().split())
cnt = 0
total = a + b + c
while a % 2 == 0 or b % 2 == 0 or c % 2 == 0:
    if a == (total - a) // 2:
        cnt = -1
        break
    a = (total - a) // 2
    b = (total - b) // 2
    c = (total - c) // 2
    cnt += 1
print(cnt)

a, b, c = map(int, input().split())
cnt = 0
total = a + b + c
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == (total - a) // 2:
        cnt = -1
        break
    a = (total - a) // 2
    b = (total - b) // 2
    c = (total - c) // 2
    cnt += 1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A, B, C = [int(_) for _ in input().split()]
 
def solve(A, B, C):
    result = 0
    if A == B == C and A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
        return -1
    while 1:
        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            return result
        A, B, C = A/2+B/2, B/2+C/2, C/2+A/2
        result += 1

print(solve(A, B, C))


A, B, C = [int(_) for _ in input().split()]
 
def solve(A, B, C):
    result = 0
    if A == B == C and A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        return -1
    while 1:
        if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
            return result
        A, B, C = A/2+B/2, B/2+C/2, C/2+A/2
        result += 1

print(solve(A, B, C))


Verdicts: Wrong Answer

Accepted