TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N squares arranged in a row. The squares are numbered 1, 2, ..., N, from left to right.  Snuke is painting each square in red, green or blue. According to his aesthetic sense, the following M conditions must all be satisfied. The i-th condition is:    * There are exactly x_i different colors among squares l_i, l_i + 1, ..., r_i.  In how many ways can the squares be painted to satisfy all the conditions? Find the count modulo 10^9+7.

Submission attempts (in order):
from collections import defaultdict

MOD = 1000000007
iist = lambda: map(int,input().split())

N,M = iist()
Q = defaultdict(list)
for i in range(M):
  l,r,x = iist()
  Q[r].append((l,x))

if any(x != 1 for l,x in Q[1]):
  print(0)
  exit(0)

dp = defaultdict(int)
dp[0,0] = 3

x_sum = [3]
y_sum = [3]
s = 3

for pk in range(1,N):
  k = pk+1

  dp.update(((i,pk),s%MOD) for i,s in enumerate(map(sum, zip(x_sum,y_sum))))

  for i in range(pk):
    x_sum[i] += dp[i,pk]
  x_sum.append(0)
  y_sum.append((2*s)%MOD)
  s *= 3

  removes = [(i,j) for i,j in dp.keys()
            if any(x != (l<=i)+(l<=j)+1 for l,x in Q[k])]

  for i,j in removes:
    c = dp[i,j]
    del dp[i,j]
    x_sum[i] -= c
    y_sum[j] -= c
    s -= c

  for i,j in range(pk):
    x_sum[i] %= MOD
    y_sum[i] %= MOD
  s %= MOD

print(s)

x_sum = [3]
y_sum = [3]
s = 3

for pk in range(1,N):
  k = pk+1

  for i,c in enumerate(map(sum,zip(x_sum,y_sum))):
    c %= MOD
    dp[i,pk] = c
    x_sum[i] += c

  x_sum.append(0)
  y_sum.append(2*s%MOD)
  s = 3*s%MOD
  subQ = Q[k]

  for i,j in list(dp.keys()):
    for l,x in subQ:
      if x != (l<=i)+(l<=j):
        c = dp[i,j]
        x_sum[i] -= c
        y_sum[j] -= c
        y_sum[j] %= MOD
        s -= c
        del dp[i,j]
        break

  for i in range(pk):
    x_sum[i] %= MOD
  s %= MOD

print(s)

from collections import defaultdict

MOD = 1000000007
iist = lambda: map(int,input().split())

N,M = iist()
Q = defaultdict(list)
for i in range(M):
  l,r,x = iist()
  Q[r].append((l,x-1))

if any(x != 0 for l,x in Q[1]):
  print(0)
  exit(0)

dp = {(0,0):3}
memo = [6]
s = 3

for pk in range(1,N):
  k = pk+1

  for i,c in enumerate(memo):
    c %= MOD
    dp[i,pk] = c
    memo[i] *= 2
    memo[i] %= MOD

  memo.append(2*s%MOD)
  s = 3*s%MOD
  subQ = Q[k]

  for i,j in list(dp.keys()):
    for l,x in subQ:
      if x != (l<=i)+(l<=j):
        c = dp[i,j]
        memo[i] -= c
        memo[j] -= c
        s -= c
        del dp[i,j]
        break

  s %= MOD

print(s)

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):
#!/usr/bin/env python3
import sys
# input = sys.stdin.r/eadline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    A,B,C = MAP()
    if not(A%2==0 and B%2==0 and C%2==0):
        print(0)
        return
        
    if A==B==C:
        print(-1)
        return
    answer = 0
    
    while A%2==0 and B%2==0 and C%2==0:
        x = A//2
        y = B//2
        z = C//2
        A = y+z
        B = x+y
        C = y+z
        answer += 1
    print(answer)

if __name__ == '__main__':
    main()


#!/usr/bin/env python3
import sys
# input = sys.stdin.r/eadline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    A,B,C = MAP()
    if not (A%2==0 and B%2==0 and C%2==0):
        print(0)
        return

    if A==B==C:
        print(-1)
        return
    answer = 0
    
    while A%2==0 and B%2==0 and C%2==0:
        x = A//2
        y = B//2
        z = C//2
        A = y+z
        B = x+y
        C = y+z
        answer += 1
    print(answer)

if __name__ == '__main__':
    main()


#!/usr/bin/env python3
import sys
# input = sys.stdin.r/eadline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    A,B,C = MAP()
    # if not (A%2==0 and B%2==0 and C%2==0):
    #     print(0)
    #     return

    if A==B==C:
        print(-1)
        return
    answer = 0
    
    while A%2==0 and B%2==0 and C%2==0:
        x = A//2
        y = B//2
        z = C//2
        A = y+z
        B = x+y
        C = y+z
        answer += 1
    print(answer)

if __name__ == '__main__':
    main()


#!/usr/bin/env python3
import sys
# input = sys.stdin.r/eadline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    A,B,C = MAP()
    if A==B==C:
        if A%2==1 or B%2==1 or C%2==1:
            print(0)
        else:
            print(-1)
        return
    answer = 0
    
    while A%2==0 and B%2==0 and C%2==0:
        x = A//2
        y = B//2
        z = C//2
        A = y+z
        B = x+z
        C = y+x
        answer += 1
    print(answer)

if __name__ == '__main__':
    main()


Verdicts: Time Limit Exceeded

Time Limit Exceeded

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):
from functools import reduce
from fractions import gcd


def main():
    cookies = list(map(int, input().split()))
    answer = -1
    if cookies[0] % 2 or cookies[1] % 2 or cookies[2] % 2:
        answer = 0
    elif len(set(cookies)) > 1:
        answer = reduce(gcd, cookies) - 1
    print(answer)


if __name__ == '__main__':
    main()



def main():
    cookies = list(map(int, input().split()))
    answer = 0
    if cookies[0] == cookies[1] == cookies[2] and cookies[0] % 2 == 0:
        answer = -1
    elif all(cookies[i] % 2 == 0 for i in range(3)):
        half = [0, 0, 0]
        sum_cookies = sum(cookies)
        while all(cookies[i] % 2 == 0 for i in range(3)):
            for i in range(3):
                half[i] = (sum_cookies - cookies[i]) // 2
            cookies[0] = half[1] + half[2]
            cookies[1] = half[0] + half[2]
            cookies[2] = half[1] + half[0]
            answer += 1
    print(answer)


if __name__ == '__main__':
    main()



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())
count=0
#if A==B and A==C:
print("-1")
exit()
while True:
  a,b,c=A/2,B/2,C/2
  A,B,C=b+c,a+c,a+b
  count+=1
  if A%2==1 or B%2==1 or C%2==1:
    break
print(count)

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

k = 0
while True:
    if A==B==C:
        k = -1
        break
    k += 1
    An = (B + C)//2
    Bn = (A + C)//2
    Cn = (B + A)//2
    A = An 
    B = Bn 
    C = Cn     
    print(A,B,C)
    if A%2==1 or B%2==1 or C%2==1 or min([A,B,C])<1:
        break

print(k)

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

k = 0
flag = 0
while k<100:
    if A%2==1 or B%2==1 or C%2==1 or min([A,B,C])<1:
        flag = 1
        break
    An = (B + C)//2
    Bn = (A + C)//2
    Cn = (B + A)//2
    A = An 
    B = Bn 
    C = Cn         
    k += 1

if not flag:
    k = -1

print(k)

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):
abc = list(map(int, input().split()))
ans = 0
for i in range(10 ** 6):   
    if abc[0] % 2 != 0:
        print(ans)
        break
    else:
        tmp1 = abc[1] // 2 + abc[2] // 2

    if abc[1] % 2 != 0:
        print(ans)
        break
    else:
        tmp2 = abc[0] // 2 + abc[2] // 2
        
    if abc[2] % 2 != 0:
        print(ans)
        break
    else:
        tmp3 = abc[0] // 2 + abc[2] // 2
        
    abc[0] = tmp1
    abc[1] = tmp2
    abc[2] = tmp3
    ans += 1

print(-1)

abc = list(map(int, input().split()))
ans = 0
for i in range(10 ** 6):   
    if abc[0] % 2 != 0:
        print(ans)
        quit()
        break
    else:
        tmp1 = abc[1] // 2 + abc[2] // 2

    if abc[1] % 2 != 0:
        print(ans)
        quit()
        break
    else:
        tmp2 = abc[0] // 2 + abc[2] // 2
        
    if abc[2] % 2 != 0:
        print(ans)
        quit()
        break
    else:
        tmp3 = abc[0] // 2 + abc[2] // 2
        
    abc[0] = tmp1
    abc[1] = tmp2
    abc[2] = tmp3
    ans += 1

print(-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())
a = [A]
b = [B]
c = [C]
count = 0
for i in range(10 ** 9):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 2 == 0 or c[i] % 2 == 1:
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1

print(count)

A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
for i in range(10 ** 9):
 
    if a[i] == b[i] == c[i]:
        count = -1
        break
    elif a[i] % 2 == 1 or b[i] % 1 == 0 or c[i] % 2 == 1:
        break
    else:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1

print(count)

A,B,C = map(int, input().split())
a = [A]
b = [B]
c = [C]
count = 0
sum = A + B + C
for i in range(10 ** 9):

    if a[i] == b[i] == c[i]:
        if a[i] % 2 == 0 and b[i] % 2 == 0 and c[i] % 2 == 0:
            count = -1
            break
        else:
            count = 0
            break
    elif a[i] % 2 == 0 and b[i] % 2 == 0 and c[i] % 2 == 0:
        a.append(b[i] / 2 + c[i] / 2)
        b.append(a[i] / 2 + c[i] / 2)
        c.append(a[i] / 2 + b[i] / 2)
        count += 1
    else:
        break


print(count)


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 = 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)

cookie = list(map(int, input().split()))
sc = sum(cookie)
cnt = 0
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)

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, = map(int, input().split())
a = [bin(abs(a[i+1]-a[i]))[::-1].find('1') for i in range(2)].sort()
print(a[1] if a[0]*a[1]<0 else a[0])

*a,=map(int,input().split())
b=[bin(a[i+1]-a[i])[::-1].find('1')for i in (0,1)]
print((max(b)*(b[0]*b[1]<0) or min(b))*(1-sum(a)%2))

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 and C == A:
  print(-1)
else:
  count = 0
  while(A%2==0 and B%2 == 0 and C%2==0):
    A_ = A
    B_ = B
    A = (B+C)/2
    B = (A_+C)/2
    C = (A_+B_)/2
    print(A,B,C)
    count+=1
  print(count)

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

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

a,b,c = map(int, input().split())
d,e,f = abs(b-a),abs(c-b),abs(a-c)
ans = 0
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
  print(0)
else: 
  if d == e and e == f:
    print(-1)
  else:
    while d % 2 == 0 and e % 2 == 0 and f % 2 == 0:
      ans += 1
      d //= 2
      e //= 2
      f //= 2
    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%2 or b%2 or c%2:
  print(0)
  exit()
elif a==b==c:
  print(-1)
  exit()
  
ans =0
while 1:
  if all(a%2==0, b%2==0, c%2==0):
    ans += 1
  else:
    print(ans)
    exit()
  a, b, c = (b+c)//2, (a+c)//2, (b+a)//2

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

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



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 = 0

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

while x%2 == 0 and y%2 == 0 and z%2 == 0:
    ans += 1

    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    
    a = x
    b = y
    c = z

print(ans)


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

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

while x%2 == 0 and y%2 == 0 and z%2 == 1:
    ans += 1
    
    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    
    a = x
    b = y
    c = z

print(ans)


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

while True:
    ans += 1
    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    if x%2 == 1 or y%2 == 1 or z%2 == 1:
        break

print(ans)


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

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

while a%2 == 0 and b%2 == 0 and c%2 == 0:
    ans += 1

    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    
    a = x
    b = y
    c = z

print(ans)


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):
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())
print(a,b,c)

count = 0
flag = 0
while True:
    at = (b+c)/2
    bt = (a+c)/2
    ct = (b+c)/2

    if flag == 1 and at == a and bt == b and ct == c:
        flag = 0
        break
    
    a = at
    b = bt
    c = ct
    
    count += 1
    flag = 1
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break

if flag == 0:
    print(-1)
else:
    print(count)


#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

count = 0
flag = 0
while True:
    at = (b+c)/2
    bt = (a+c)/2
    ct = (b+a)/2

    if flag == 0 and (a % 2 == 1 or b % 2 == 1 or c % 2 == 1):
        flag = 1
        break
    if flag == 1 and at == a and bt == b and ct == c:
        flag = 0
        break
    
    a = at
    b = bt
    c = ct
    #print(a,b,c)
    count += 1
    flag = 1
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break

if flag == 0:
    print(-1)
else:
    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):
a,b,c=map(int,input().split())
if a==b==c:
    if a%2===b%2==c%2==0:
        print(-1)
    else:
        print(0)
    exit()
cnt=0
while a%2==b%2==c%2:
    A=a//2
    B=b//2
    C=c//2
    a,b,c=B+C,A+C,A+B
    cnt+=1
print(cnt)

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

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

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


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)


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(i) for i in input().split())

times =  0

if A%2==1 or B%2==1 or C%2==1:
    times = 0
else:
    while True:
        times += 1
        A = A / 2
        B = B / 2
        C = C / 2
        if A==B and C==A:
            times = -1
            break
        elif A<=1 or B<=1 or C<=1:
            break
        elif A%2==1 and B%2==1 and C%2==1:
            continue
        elif A%2==1 or B%2==1 or C%2==1:
            break
        
        

print(times)

A,B,C = (int(i) for i in input().split())

times =  0

if A%2==1 or B%2==1 or C%2==1:
    times = 0
else:
    while True:
        times += 1
        A = A / 2
        B = B / 2
        C = C / 2
       # print(A,B,C)
        if A==B and C==A:
            times = -1
            break
        elif A%2==1 and B%2==1 and C%2==1:
            continue
        elif A%2==1 or B%2==1 or C%2==1:
            break
        
        elif A%1!=0 or B%1!=0 or C%1!=0:
            break
        elif A<=1 or B<=1 or C<=1:
            break
        

print(times)

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
for i in range(100):
    if a==b==c and a%2==0:
        cnt = -1
        break
    elif a%2==0 and b%2==0 and c%2==10:
        t_a = b//2 + c//2
        t_b = a//2 + c//2
        t_c = a//2 + b//2
        a,b,c = t_a,t_b,t_c
        cnt+=1
    else:
        break
print(cnt)

a,b,c = map(int,input().split())
cnt=0
if a==b==c and a%2==0:
    cnt = -1
    break
elif:
    for i in range(100):
        if a%2==0 and b%2==0 and c%2==10:
            t_a = b//2 + c//2
            t_b = a//2 + c//2
            t_c = a//2 + b//2
            a,b,c = t_a,t_b,t_c
            cnt+=1
        else:
            break
print(cnt)

a,b,c = map(int,input().split())
cnt=0
if a==b==c and a%2==0:
    cnt = -1
else:
    for i in range(100):
        if a%2==0 and b%2==0 and c%2==0:
            t_a = b//2 + c//2
            t_b = a//2 + c//2
            t_c = a//2 + b//2
            a,b,c = t_a,t_b,t_c
            cnt+=1
        else:
            break
print(cnt)

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):
import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy


def odd(n): return n & 1


def even(n): return not odd(n)

S = input()
dump(S)
print(S)



import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy


def odd(n): return n & 1


def even(n): return not odd(n)

S = input()
dump(S)
print(S)



import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy


def odd(n): return n & 1


def even(n): return not odd(n)

S = input()
dump(S)
print(S)



import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy


def odd(n): return n & 1


def even(n): return not odd(n)


A, B, C = map(int, input().split())
ans = 0
a, b, c = A, B, C
while True:
    dump(a, b, c)
    if odd(a) or odd(b) or odd(c):
        print(ans)
        exit()
    if ans > 0 and a == A and b == B and c == C:
        print(-1)
        exit()
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    ans += 1


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 = list(map(int, input().split(' ')))
cnt = 0
if a == b == c:
    cnt = -1  
else:
    while (a+1)%2 or (b+1)%2 or (c+1)%2:
        cnt += 1
        a,b,c=(b+c)/2,(a+c)/2,(a+b)/2

print(cnt)



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

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

compute()


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

compute()


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 numpy as np
import sys

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

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

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

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

import numpy as np
import sys

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

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

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

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

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):
from time import time
t = time()
count = 0
a = int(input())
b = int(input())
c = int(input())
while True:
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        print(count)
        exit()
    count += 1
    a1 = b//2+c//2
    b1 = c//2+a//2
    c1 = a//2+b//2
    a = a1
    b = b1
    c = c1
    if time()-t >= 1.8:
        print(-1)
        exit()

from time import time
t = time()
count = 0
a,b,c = map(int,input().split())
while True:
    if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
        print(count)
        exit()
    count += 1
    a1 = b//2+c//2
    b1 = c//2+a//2
    c1 = a//2+b//2
    a = a1
    b = b1
    c = c1
    if time()-t >= 1.8:
        print(-1)
        exit()

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):
"""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""

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


"""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""

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


"""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""

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


"""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""

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


"""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""

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


Verdicts: Wrong Answer

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):
if A==B==C:
    print(-1)
else:
    for i in range(100000000):
        if A %2==0 and B%2==0 and C%2==0:
            a = A/2
            b = B/2
            c = C/2
            A = b+c
            B = a+c
            C = a+b
        else:
            print(i)
            exit()

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(1000000000):
        if A %2==0 and B%2==0 and C%2==0:
            a = A/2
            b = B/2
            c = C/2
            A = b+c
            B = a+c
            C = a+b
        else:
            print(i)
            exit()



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):
#13
a,b,c = map(int,input().split())
cnt = 0
while a%2 == b%2 == c%2 == 0:
    if a==b==c:
        print('-1')
        break
    else:
        a,b,c = b//2+c//2,c//2+a//2,a//2+b//2
        cnt+=1
        print(a,b,c)

print(cnt)

#13
a,b,c = map(int,input().split())
cnt = 0
if a%2 == 1 or b%2 == 1 or c%2 == 1:
    print('0')

elif a==b==c and a%2==0:
            print('-1')
    
elif not a==b==c:
    while a%2 == b%2 == c%2 == 0:
        a,b,c = b//2+c//2,c//2+a//2,a//2+b//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 = map(int, input().split())
count = 0
if a == 1 and b == 1 and c == 1:
  break
elif a == b and a == c:
  count = -1
else:
  while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    a_copy = a
    b_copy = b
    c_copy = c
    a = int(b_copy / 2 + c_copy / 2)
    b = int(a_copy / 2 + c_copy / 2)
    c = int(b_copy / 2 + a_copy / 2)
    count += 1
  
print(count)

a , b , c = map(int, input().split())
count = 0
if a == 1 and b == 1 and c == 1:
  pass
elif a == b and a == c:
  count = -1
else:
  while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    a_copy = a
    b_copy = b
    c_copy = c
    a = int(b_copy / 2 + c_copy / 2)
    b = int(a_copy / 2 + c_copy / 2)
    c = int(b_copy / 2 + a_copy / 2)
    count += 1
  
print(count)

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=sorted(list(map(int,input().split())))

if A[2]==A[0]:
    print(-1)
else:
    c=A[2]-A[0]
    while c%2==1:
        c+=1
        c=c//2
    print(c)




A=sorted(list(map(int,input().split())))

if A[2]==A[0]:
    print(-1)
else:
    c=A[2]-A[0]
    while c%2==0:
        c+=1
        c=c//2
    print(c)






A=sorted(list(map(int,input().split())))

if A[2]==A[0] and A[0]%2==0:
    print(-1)
else:
    ans=0
    a=A[0]
    b=A[1]
    c=A[2]
    while a%2==0 and b%2==0 and c%2==0:
        ans+=1
        a,b,c=(b+c)//2,(a+c)//2,(a+b)//2
    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=map(int,input().split())
if a==b and b==c and a%2=0:
    print(-1)
else:
    ans=0
    while a%2==0 ans b%2==0 and c%2==0:
        tmp=a
        tmp2=b
        a=(b+c)//2
        b=(c+tmp)//2
        c=(tmp+tmp2)//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:
        tmp=a
        tmp2=b
        a=(b+c)//2
        b=(c+tmp)//2
        c=(tmp+tmp2)//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())
if a == b == c:
  if a%2 == b%2 == c%2 == 0:
    print(-1)
  else:
    print(0)
t = 0
else:
  while t > -1:
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
      break
    (a,b,c) = ((b+c)//2,(a+c)//2,(a+b)//2)
    t += 1
  print(t)

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


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


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)


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:
    if a % 2:
        print(0)
    else:
        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)


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())

ans = 0

while (A%2 == 0) & (B%2 == 0) & (C%2 == 0):
    if (A==B) & (B==C) :
        ans = -1
        break

    a = (B+C)/2
    b = (A+C)/2
    c = (A+B)/2
    A = a
    B = b
    C = c
        ans += 1

print(ans)

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

ans = 0

while (A%2 == 0) & (B%2 == 0) & (C%2 == 0):
    if (A==B) & (B==C) :
        ans = -1
        break

    a = (B+C)/2
    b = (A+C)/2
    c = (A+B)/2
    A = a
    B = b
    C = c
    ans += 1

print(ans)

Verdicts: Runtime Error

Accepted