Problem:


Score : 300 points

Problem Statement

You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:

Choose two among A, B and C, then increase both by 1.

Choose one among A, B and C, then increase it by 2.

It can be proved that we can always make A, B and C all equal by repeatedly performing these operations.

Constraints

0 \leq A,B,C \leq 50

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B C

Output

Print the minimum number of operations required to make A, B and C all equal.

Sample Input 1

2 5 4

Sample Output 1

2

We can make A, B and C all equal by the following operations:

Increase A and C by 1. Now, A, B, C are 3, 5, 5, respectively.

Increase A by 2. Now, A, B, C are 5, 5, 5, respectively.

Sample Input 2

2 6 3

Sample Output 2

5

Sample Input 3

31 41 5

Sample Output 3

23



Sample input:
2 5 4


Sample output:
2

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
 
even = 0
odd = 0
for a in A:
  if(a%2==0):
    even += 1
 
for i in range(len(A)):
  if(A[i]%2==0 and even == 2):
    A[i] += 1
  elif(A[i]%2==1 and even == 1):
    A[i] += 1

if(even == 2 or even == 1):
  ans = 1
else:
  ans = 0
 
for a in A:
  ans += (max(A) - a) // 2
 
print(a)

Submission status: Wrong Answer

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

ans = 0

even = 0
odd = 0
for a in A:
  if(a%2==0):
    even += 1

for i in range(len(A)):
  if(A[i]%2==0 and even == 2):
    A[i] += 1
  elif(A[i]%2==1 and even == 1):
    A[i] += 1

for a in A:
  ans += (max(A) - a) // 2

print(a)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Aug  8 12:24:08 2018

@author: Yuki
"""

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

max_of_int = max(A, max(B, C))
sum_of_delta = 3 * max_of_int - (A + B + C)

if sum_of_delta % 2 == 0:
    print(sum_of_delta//2)
else:
    print(sum_of_delta//2 + 1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Aug  8 12:24:08 2018

@author: Yuki
"""

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

sum_of_delta = A + B + C
if sum_of_delta % 2 == 0:
    print(sum_of_delta//2)
else:
    print(sum_of_delta//2 + 1)

Submission status: Wrong Answer

Solution code:
def get_only(list_, key=lambda x: x):
	for v in set(list_):
		if [key(w) for w in list_].count(key(v)) == 1:
			return v

# abc = list(map(int, input().split(" ")))
# only_num = get_only(abc, key=lambda x: x%2)

# if only_num:
# 	abc.remove(only_num)
# 	abc = [only_num] + [abc_i+1 for abc_i in abc]
# std = max(abc)
# abc.remove(std)
# x, y = abc

# print((abs(std-x) + abs(std-y))//2+bool(only_num))

abc = list(map(int, input().split(" ")))

only_num = get_only(abc, key=lambda x: x%2)
if only_num:
	abc.remove(only_num)
	abc = [only_num] + [abc_i+1 for abc_i in abc]
max_num = max(abc)
abc.remove(max_num)

print((max_num-abc[0] + max_num-abc[1])//2+bool(only_num))

Submission status: Wrong Answer

Solution code:
def get_only(list_, key=lambda x: x):
	for v in set(list_):
		if [key(w) for w in list_].count(key(v)) == 1:
			return v

abc = list(map(int, input().split(" ")))
only_num = get_only(abc, key=lambda x: x%2)

if only_num:
	abc.remove(only_num)
	abc = [only_num] + [abc_i+1 for abc_i in abc]
std = max(abc)
abc.remove(std)
x, y = abc

print((abs(std-x) + abs(std-y))//2+bool(only_num))

Submission status: Wrong Answer

Solution code:
l=sorted(map(int,input().split()))
a=(l[2]-l[0])//2
b=(l[2]-l[1])//2
l[0]+=a*2
l[1]+=b*2
if l[0]==l[1]==l[2]:
  print(a+b)
else:
  print(a+b+2)

Submission status: Wrong Answer

Solution code:
l=sorted(map(int,input().split()))
c=0
if (l[0]%2==0 and l[1]%2==1) or (l[0]%2==1 and l[1]%2==0):
    l[0]+=1
    l[2]+=1
    c=1
c+=(l[2]-l[0])//2
c+=(l[2]-l[1])//2
l[0]+=(l[2]-l[0])//2*2
l[1]+=(l[2]-l[1])//2*2
c+=(l[2]-l[0])
c+=(l[2]-l[1])
print(c)

Submission status: Wrong Answer

Solution code:
l=sorted(map(int,input().split()))
c=0
if (l[0]%2==0 and l[1]%2==1) or (l[0]%2==1 and l[1]%2==0):
    l[0]+=1
    l[2]+=1
    c=1+l[2]-l[0]
else:
    l[0]+=(l[2]-l[1])
    c+=(l[2]-l[1])
    c+=(l[2]-l[0])/2
print(int(c))

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
ans = 0
while True:
	A, B, C = sorted([A, B, C])
	if C - A > 1:
		A += 2
		ans += 1
	else:
		A += 1
		B += 1
		ans += 1
	if A == B == C:
		break
print(ans)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
ans = 0
while True:
	A, B, C = sorted([A, B, C])
	if C - A > 1:
		A += 2
	else:
		A += 1
		B += 1
	ans += 1
	if A == B == C:
		break
print(ans)

Submission status: Wrong Answer

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

ct = 0
while True:
    if a.count(max(a)) == 3:
        break
    tmp = min(a)
    tmp += 2
    a.remove(min(a))
    a.append(tmp)
    ct += 1

    if max(a) == min(a) + 1 and a.count(max(a)) == 1:
        ct += 1
        break
print(ct)

Submission status: Wrong Answer

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

ct = 0
while True:
    tmp = min(a)
    tmp += 2
    a.remove(min(a))
    a.append(tmp)
    ct += 1
    if a.count(max(a)) == 3:
        break
    if max(a) == min(a) + 1 and a.count(max(a)) == 1:
        ct += 1
        break
print(ct)

Submission status: Wrong Answer

Solution code:
A , B , C = map(int, input().split())
a = [A, B, C]
print(a)

ct = 0
while True:
    tmp = min(a)
    tmp += 2
    a.remove(min(a))
    a.append(tmp)
    ct += 1
    print(a)
    if a.count(max(a)) == 3:
        break
    if max(a) == min(a) + 1 and a.count(max(a)) == 1:
        ct += 1
        break
print(ct)

Submission status: Wrong Answer

Solution code:
from collections import Counter
def getinputdata():

    array_result = []
    
    array_result.append(input().split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

arr = sorted([int(x) for x in arr_data[0]])

mindata = int(arr[0])
middledata = int(arr[1])
maxdata = int(arr[2])

sabun01 = middledata-mindata
sabun02 = maxdata-middledata
sabun03 = maxdata-mindata

#print(sabun01,sabun02,sabun03)

#minをmiddleに寄せてから　middleをmax
if sabun01 % 2 == 0:
    cnt01 = (sabun01 // 2) + sabun02

elif sabun01 % 2 != 0 and sabun02 % 2 != 0:
    cnt01 = (sabun01 // 2) + 1 + 2 + sabun02-1

elif sabun01 % 2 != 0 and sabun02 % 2 == 0:
    cnt01 = (sabun01 // 2) + 1 + sabun02

#middleをmaxに寄せてから　minをmax
if sabun02 % 2 == 0:
    cnt02 = (sabun02 // 2) + sabun03
    
elif sabun02 % 2 != 0 and sabun03 % 2 != 0:
    
    cnt02 = (sabun02 // 2) + 1  + 2 + sabun03-1
    
elif sabun02 % 2 != 0 and sabun03 % 2 == 0:
    
    cnt02 = (sabun02 // 2) + 1 + sabun03

print(min(cnt01,cnt02))

Submission status: Wrong Answer

Solution code:
from collections import Counter
def getinputdata():

    array_result = []
    
    array_result.append(input().split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

arr = sorted([int(x) for x in arr_data[0]])

mindata = int(arr[0])
middledata = int(arr[1])
maxdata = int(arr[2])

sabun01 = middledata-mindata
sabun02 = maxdata-middledata
sabun03 = maxdata-mindata

#minをmiddleに寄せてから　middleをmax
if sabun01 % 2 == 0:
    cnt01 = (sabun01 // 2) + sabun02

elif sabun01 % 2 != 0 and sabun02 % 2 != 0:
    cnt01 = (sabun01 // 2) + 1 + 2 + sabun02-1

elif sabun01 % 2 != 0 and sabun02 % 2 == 0:
    cnt01 = (sabun01 // 2) + 1 + sabun02

#middleをmaxに寄せてから　minをmax
cnt02 = (sabun02 // 2) + sabun03 if sabun02 % 2 == 0 else (sabun02 // 2) + 1  + sabun03

print(min(cnt01,cnt02))

Submission status: Wrong Answer

Solution code:
from collections import Counter
def getinputdata():

    array_result = []
    
    array_result.append(input().split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

arr = [int(x) for x in arr_data[0]]
arr.sort()

mindata = int(arr[0])
middledata = int(arr[1])
maxdata = int(arr[2])

sabun01 = middledata-mindata
sabun02 = maxdata-middledata

if sabun01 % 2==0:
    
    cnt= (sabun01//2) + sabun02
    
elif sabun01 % 2!=0 and sabun02 % 2!=0:
    
    cnt= (sabun01//2) +1 +2 +sabun02-1

elif sabun01 % 2!=0 and sabun02 % 2==0:
       
    cnt= (sabun01//2) +1 + sabun02
    
print(cnt)
    
    
    

#middledata += sabun01
#mindata += sabun01
#
#
#print(mindata, middledata, maxdata)
#
#

Submission status: Wrong Answer

Solution code:
import math
def kaisuu(hoge):
	a = sorted(hoge)
	A = a[2]
	B = a[1]
	C = a[0]
	print(a)
	return math.floor(A-((B+C)/2))


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

count = 0
for i in X:
	if i % 2 == 0:
		count+=1

if count == 0 or count == 3:
	print(kaisuu(X))
elif count == 1:
	for i in range(3):
		if X[i] % 2 == 1:
			X[i]+=1
	print(kaisuu(X)+1)
else:
	for i in range(3):
		if X[i] % 2 == 0:
			X[i]+=1
	print(kaisuu(X)+1)

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
a = sorted(a)
counter = 0

x = (a[1]-a[0])//2
y = (a[1]-a[0])%2
counter +=x+y
z = (a[2]-a[1])//2
s = (a[2]-a[1])%2
if z == 0:
    counter += z+s
else:
    counter += (z+s)*2

print(int(counter))

Submission status: Wrong Answer

Solution code:
# input
X = list(map(int, input().split()))

X.sort()

if (X[1] - X[0]) % 2 == 0:
    ans = X[2] - X[1] // 2 - X[0] // 2 
else:
    ans = X[2] - X[1] + 1 + (X[1] - X[0] + 1) //2

print(ans)

Submission status: Wrong Answer

Solution code:
# input
X = list(map(int, input().split()))

X.sort()

if (2 * X[2] - X[1] - X[0]) % 2 == 0:
    ans = (2 * X[2] - X[1] - X[0]) // 2
else:
    ans = (2 * X[2] - X[1] - X[0] + 1) // 2

print(ans)

Submission status: Wrong Answer

Solution code:
# input
X = list(map(int, input().split()))

X.sort()

if (2 * X[2] - X[1] - X[0]) % 2 == 0:
    ans = (2 * X[2] - X[1] - X[0]) / 2
else:
    ans = (2 * X[2] - X[1] - X[0] + 1) / 2

print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
saidai=max(A,B,C)
saishou=min(A,B,C)
middle=0
count=0

if A!=saidai and A!=saishou:
    middle=A
elif B!=saidai and B!=saishou:
    middle=B
else:
    middle=C
    
count=saidai-middle
saishou+=count

if (saidai-saishou)%2==0:
    count=count+int((saidai-saishou)/2)
else:
    count=+2+count+int((saidai-saishou)/2)

print(count)

Submission status: Wrong Answer

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

B = [A[0]-min(A),A[1]-min(A),A[2]-min(A)]
B.sort()

ans = 0
if B[1] % 2 == 0:
    ans += B[1] / 2
    B[2] -= B[1]
else:
    ans += B[1]

print(int(ans + B[2]))

Submission status: Wrong Answer

Solution code:
ls = list(map(int, input().split()))
ans = sum(ls) - max(ls)
print(ans//2 if ans%2 == 0 else (ans+3)//2)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
x=max(a,b,c)
total=a+b+c
for i in range(x,51):
    ans=3*i-total
    if ans%2==0:
        print(ans//2)
        exit()

Submission status: Wrong Answer

Solution code:
x = list(map(int,input().split()))
x.sort()
ans=0
while not x[0]==x[1]==x[2]:
    if x[1]!=x[2]:
        x[0]+=1
        x[1]+=1
        ans+=1
    else:
        x[0]+=2
        ans+=1
        if x[0]!=x[1]:
            x[1]+=1
            x[2]+=1
            ans+=1      
print(ans)

Submission status: Wrong Answer

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

m = max(A, B, C)
num1 = min(A, B, C)
num2 = min(max(A, B), C) if A == num1 or B == num1 else min(max(B, C), A)
count = 0

if (m - num1) % 2 == (m - num2) % 2:
    if (m - num1) % 2 == 0:
        count += (m - num1) / 2
        count += (m - num2) / 2
    else:
        count += (m - num1) // 2
        count += (m - num2) // 2
        count += 1
    print(count)

else:
    if (m - num1) % 2 == 0:
        count += (m - num1) / 2
        count += (m - num2) // 2
        count += 2
    else:
        count += (m - num2) / 2
        count += (m - num1) // 2
        count += 2
    print(count)

Submission status: Wrong Answer

Solution code:
a = sorted(list(map(int, input().split())))[::-1]
if a[0]%2 != a[1]%2 or a[1]%2 != a[2]%2 or  a[2]%2 != a[0]%2:
    print((2*a[0]-a[1]-a[2])//2+2)
else:
    print((2*a[0]-a[1]-a[2])//2)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))[::-1]
if a[0]%2 != a[1]%2 or a[1]%2 != a[2]%2 or  a[2]%2 != a[0]%2:
    print((2*a[0]-a[1]-a[2])//2+2)
else:
    print((2*a[0]-a[1]-a[2])//2)

Submission status: Wrong Answer

Solution code:
numList = input().split()
numList = list(map(int, numList))
commandList = [
	[2,0,0],
	[0,2,0],
	[0,0,2],
	[0,1,1],
	[1,0,1],
	[1,1,0]
]
numListList = [numList]

def search(depth):
	global numListList
	tmpList = []
	for numList in numListList:
		for command in commandList:
			sumedList = sumList(numList, command)
			if check(sumedList, depth+1):
				return
			tmpList.append(sumedList)
	numListList = tmpList
	search(depth+1)

def sumList(list1, list2):
	return [list1[0]+list2[0], list1[1]+list2[1], list1[2]+list2[2]]

def check(numList, count):
	if numList[0] == numList[1] and numList[1] == numList[2]:
		print(count)
		return True

	if numList[0] == numList[1]:
		return check2(numList[0], numList[2], count)

	if numList[1] == numList[2]:
		return check2(numList[1], numList[0], count)

	if numList[0] == numList[2]:
		return check2(numList[0], numList[1], count)

	return False

def check2(num1, num2, count):
	if num1 > num2:
		if (num1-num2)%2 == 0:
			print(int(count+(num1-num2)/2))
			return True
		else:
			print(int(count+(num1-num2)/2)+1)
			return True
	else:
		print(int(count+(num2-num1)))
		return True

if check(numList, 0):
	pass
else:
	search(0)

Submission status: Wrong Answer

Solution code:
numList = input().split()
numList = list(map(int, numList))
commandList = [
	[2,0,0],
	[0,2,0],
	[0,0,2],
	[0,1,1],
	[1,0,1],
	[1,1,0]
]
numListList = [numList]

def search(depth):
	global numListList
	tmpList = []
	for numList in numListList:
		for command in commandList:
			sumedList = sumList(numList, command)
			if check(sumedList, depth+1):
				return
			tmpList.append(sumedList)
	numListList = tmpList
	search(depth+1)

def sumList(list1, list2):
	return [list1[0]+list2[0], list1[1]+list2[1], list1[2]+list2[2]]

def check(list1, count):
	if list1[0] == list1[1] and list1[1] == list1[2]:
		print(count)
		return True

	if list1[0] == list1[1]:
		return check2(list1[0], list1[2], count)

	if list1[1] == list1[2]:
		return check2(list1[1], list1[0], count)

	if list1[0] == list1[2]:
		return check2(list1[0], list1[1], count)

	return False

def check2(num1, num2, count):
	if num1 > num2:
		if (num1-num2)%2 == 0:
			print(int(count+(num1-num2)/2))
			return True
		else:
			print(int(count+(num1-num2)/2)+1)
			return True
	else:
		print(int(count+(num2-num1)))
		return True

if check(numList, 0):
	pass
else:
	search(0)

Submission status: Wrong Answer

Solution code:
numList = input().split()
numList = list(map(int, numList))
commandList = [
	[2,0,0],
	[0,2,0],
	[0,0,2],
	[0,1,1],
	[1,0,1],
	[1,1,0]
]
numListList = [numList]

def search(depth):
	global numListList
	tmpList = []
	for numList in numListList:
		for command in commandList:
			sumedList = sumList(numList, command)
			if check(sumedList, depth+1):
				return
			tmpList.append(sumedList)
	numListList = tmpList
	search(depth+1)

def sumList(list1, list2):
	return [list1[0]+list2[0], list1[1]+list2[1], list1[2]+list2[2]]

def check(list1, count):
	if list1[0] == list1[1] and list1[1] == list1[2]:
		print(count)
		return True

	if list1[0] == list1[1]:
		return check2(list1[0], list1[2], count)

	if list1[1] == list1[2]:
		return check2(list1[1], list1[0], count)

	if list1[0] == list1[2]:
		return check2(list1[0], list1[1], count)

	return False

def check2(num1, num2, count):
	if num1 > num2:
		if (num1-num2)%2 == 0:
			print(int(count+(num1-num2)/2))
			return True
		else:
			print(int(count+(num1-num2)/2)+1)
			return True
	else:
		print(int(count+(num2-num1)))
		return True

if numList[0] == numList[1] and numList[1] == numList[2]:
	print(0)
else:
	search(0)

Submission status: Wrong Answer

Solution code:
numList = input().split()
numList = list(map(int, numList))
commandList = [
	[2,0,0],
	[0,2,0],
	[0,0,2],
	[0,1,1],
	[1,0,1],
	[1,1,0]
]
numListList = [numList]

def search(depth):
	global numListList
	tmpList = []
	for numList in numListList:
		for command in commandList:
			sumedList = sumList(numList, command)
			if check(sumedList):
				print(depth+1)
				return
			tmpList.append(sumedList)
	numListList = tmpList
	search(depth+1)

def sumList(list1, list2):
	return [list1[0]+list2[0], list1[1]+list2[1], list1[2]+list2[2]]

def check(list1):
	if list1[0] == list1[1] and list1[1] == list1[2]:
		return True
	else:
		return False

search(0)

Submission status: Wrong Answer

Solution code:
As = [ int(i) for i in input('>> ').split()]

As.sort()
As.reverse()

o = 0
diff = As[0] - As[1]
div, mod = divmod(diff,2)
o += div

if mod == 1:
    As[2] += 1
    o += 1

diff = As[0] - As[2]
div, mod = divmod(diff,2)
o += div
if mod == 1:
    o += 1
    o += mod
print(o)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
list = [A,B,C]
list.sort(reverse=True)
print(list)
import copy
#処理の回数カウンタ
cnt=0
if (list[0]-list[2])%2==0:
    #一番小さい数と一番大き数の差が偶数であれば一緒になるように２を足す処理を複数回行う
    cnt += (list[0]-list[2])/2
    list[2]=copy.deepcopy(list[0])
    if (list[0]-list[1])%2==0:
        cnt += (list[0]-list[1])/2
    else:
        cnt += int((list[0]-list[1])/2)+2
else:
    #一番大きい数と一番小さい数の差が偶数でない時
    if (list[0]-list[1])%2==0:
        #一番大き数と真ん中の数の差が偶数
        cnt += (list[0]-list[1])/2
        cnt += int((list[0]-list[2])/2)+2
    else:
        #一番大きい数と真ん中の数の差が奇数＝一番小さい数と真ん中の数の差が偶数
        cnt += (list[1]-list[2])/2
        cnt += (list[0]-list[1])
print(int(cnt))
#print(list)

Submission status: Wrong Answer

Solution code:
L = [int(i) for i in input().split()]
count = 0
L.sort()
while L[2]-L[0] >= 2:
    L[0] += 2
    count += 1
while L[2]-L[1] >= 2:
    L[1] += 2
    count += 1
L.sort()
print(L)
if L[0] != L[1]:
    count += 2
else:
    if L[0] != L[2]:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
m = max(a, b, c)*3
s = a + b + c
d = m - s

if m%2 == s%2:
    add = d/2
else:
    add = d-1/2 + 2
    
print(int(add))

Submission status: Wrong Answer

Solution code:
lst = list(map(int,input().split()))

m = 0
for i in range(len(lst)):
    m = max(m,lst[i])
    
for i in range(len(lst)):
    if lst[i]==m:
        idx = i

idx_1 = (idx + 1 + 3)%3
idx_2 = (idx - 1 + 3)%3

if lst[idx_1] == lst[idx_2] and lst[idx_1]+1 == lst[idx]: print(1)
else:
    cnt_1 = (lst[idx]-lst[idx_1])//2 + (lst[idx]-lst[idx_1])%2
    lst[idx_1] += 2*cnt_1
    cnt_2 = (lst[idx]-lst[idx_2])//2 + (lst[idx]-lst[idx_2])%2
    lst[idx_2] += 2*cnt_2

    if lst[0] == lst[1] and lst[1] == lst[2]:
        print(cnt_1 + cnt_2)
    else: print(cnt_1 + cnt_2 +1)

Submission status: Wrong Answer

Solution code:
lst = list(map(int,input().split()))

m = 0
for i in range(len(lst)):
    m = max(m,lst[i])
    
for i in range(len(lst)):
    if lst[i]==m:
        idx = i

idx_1 = (idx + 1 + 3)%3
idx_2 = (idx - 1 + 3)%3

cnt_1 = (lst[idx]-lst[idx_1])//2 + (lst[idx]-lst[idx_1])%2
lst[idx_1] += 2*cnt_1
cnt_2 = (lst[idx]-lst[idx_2])//2 + (lst[idx]-lst[idx_2])%2
lst[idx_2] += 2*cnt_2

if lst[0] == lst[1] and lst[1] == lst[2]:
    print(cnt_1 + cnt_2)
else: print(cnt_1 + cnt_2 +1)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
	inp = map(int, input().split(' '))
	a,b,c = inp
	step = 0
	mx = max((a,b,c))

	while True:
		step += 1
		if a<mx-1:
			a+=2
		elif b<mx-1:
			b+=2
		elif c<mx-1:
			c+=2
		else:
			break

	if 3*max((a,b,c)) == a+b+c+1:
		step+=1

	print(step)

Submission status: Wrong Answer

Solution code:
l = list(sorted(list(map(int,input().split()))))

a = l[0]
b = l[1]
c = l[2]

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

Submission status: Wrong Answer

Solution code:
l = list(sorted(list(map(int,input().split()))))

a = l[0]
b = l[1]
c = l[2]

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

Submission status: Wrong Answer

Solution code:
l = list(sorted(list(map(int,input().split()))))

a = l[0]
b = l[1]
c = l[2]

if a == b and b == c:
    print(0)
elif a == b :
    print(c-b)
elif b == c :
    if (b - a ) % 2 ==0:
        print((b-a)//2)
    else:
        print(((b+1) - a) //2 + 1)
else:
    None
    if ( c-b ) % 2 == 0:
        count = (c-b)  // 2
        if (b - a ) % 2 ==0:
            print((b-a)//2 + count)
        else:
            print(((b+1) - a) //2 + 1 + count)
    else:
        cc = (c-b-1)//2
        if (b - a ) % 2 ==0:
            print((b-a)//2 + cc)
        else:
            print(((b+1) - a) //2 + 1 + cc)

Submission status: Wrong Answer

Solution code:
l = list(sorted(list(map(int,input().split()))))

a = l[0]
b = l[1]
c = l[2]

if a == b and b == c:
    print(0)
elif a == b :
    print(c-b)
elif b == c :
    if (b - a ) % 2 ==0:
        print((b-a)//2)
    else:
        print(((b+1) - a) //2 + 1)
else:
    None
    
if ( c-b ) % 2 == 0:
    count = (c-b)  // 2
    if (b - a ) % 2 ==0:
        print((b-a)//2 + count)
    else:
        print(((b+1) - a) //2 + 1 + count)
else:
    cc =(c-b-1)//2
    if (b - a ) % 2 ==0:
        print((b-a)//2 + cc)
    else:
        print(((b+1) - a) //2 + 1 + cc)

Submission status: Wrong Answer

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

counter = 0
total = A + B + C

while True:
    counter += 1
    total += 2
    if total % 3 == 0 and total/3 >= A and total/3 >= B and total/3 >= C:
        break
print(counter)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
a.sort()
print(a)
count=(a[2]-a[0])//2
count+=(a[2]-a[1])//2
if (a[2]-a[0])%2+(a[2]-a[1])%2 == 2:
    count+=1
elif (a[2]-a[0])%2+(a[2]-a[1])%2 ==1:
    count+=2
print(count)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
A, B, C = sorted([a, b, c])
if (B - A) % 2 == (C - A) % 2 == 0:
    print((C - A) // 2 + (C - B) // 2)
elif (B - A) % 2 == (C - A) % 2 == 1:
    print((C - A) // 2 + (C - B) // 2 + 1)
else:
    print((C - A) // 2 + (C - B) // 2 + 2)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int,input().split())
ABC = sorted([A,B,C])
counter = 0
for i in range(ABC[1],ABC[2]):
    ABC[0] += 1
    ABC[1] += 1
    counter += 1
while(ABC[0]+2<=ABC[1]):
    ABC[0] += 2
    counter += 1
if ABC[0]!=ABC[1]:
    ABC[1] += 1
    ABC[2] += 1
    counter += 1
    ABC[0] += 2
    counter += 1
ABC,counter

Submission status: Wrong Answer

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

for i in range (50):
    MAX=max(A,B,C)
    Number=0
    if MAX==A:
        Number=Number+1
    if MAX==B:
        Number=Number+1
    if MAX==C:
        Number=Number+1

    if Number ==1:
        MAX=max(A,B,C)
        if MAX!=A:
            A=A+1
        if MAX!=B:
            B=B+1
        if MAX!=C:
            C=C+1
        count=count +1
        Number=0

    if Number ==2:
        MAX=max(A,B,C)
        if MAX!=A:
            A=A+2
        if MAX!=B:
            B=B+2
        if MAX!=C:
            C=C+2
        count=count +1
        Number=0
    
    if Number ==3:
        print('%d'%(count))
        break

Submission status: Wrong Answer

Solution code:
a = sorted(list(map(int,input().split())))
d = 3*a[2] - sum(a)
if d%2 == 0:
    print(int(d/2))
else:
    print(int(3*(a[2]+1) - sum(a))/2)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
A, B, C = sorted([a, b, c])
if (B - A) % 2 == (C - A) % 2 == 0:
    print((C - A) // 2 + (C - B) // 2)
else:
    print((C - A) // 2 + (C - B) // 2 + 2)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
A, B, C = sorted([a, b, c])
print(A,B,C)
if (B - A) % 2 == (C - A) % 2 == 0:
    print((C - A) // 2 + (C - B) // 2)
else:
    print((C - A) // 2 + (C - B) // 2 + 2)

Submission status: Wrong Answer

Solution code:
a = sorted(list(map(int,input().split())))
d = 3*a[2] - sum(a)
if d%2 == 0:
    print(int(d/2))
else:
    print(int((d+1)/2))

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
A, B, C = sorted([a, b, c])
print(A,B,C)
if (B - A) % 2 == (C - A) % 2 == 0:
    print((B - A) // 2 + (C - A) // 2)
else:
    print((C - A) // 2 + (C - B) // 2 + 2)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
A, B, C = sorted([a, b, c])
print(A,B,C)
if (B - A) % 2 == (C - A) % 2 == 0:
    print((B - A) // 2 + (C - A) // 2)
elif (B - A) % 2 == (C - A) % 2 == 1:
    print((C - A) // 2 + (C - B) // 2 + 1)
else:
    print((C - A) // 2 + (C - B) // 2 + 2)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
A, B, C = sorted([a, b, c])
print(A,B,C)
if (B - A) % 2 == (C - A) % 2 == 0:
	print((B - A) // 2 + (C - A) // 2)
elif (B - A) % 2 == (C - A) % 2 == 1:
    print((C - A) // 2 + (C - B) // 2 + 1)
else:
    print((C - A) // 2 + (C - B) // 2 + 2)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
A, B, C = sorted([a, b, c])
if (B - A) % 2 == (C - A) % 2 == 0:
	print((B - A) // 2 + (C - A) // 2)
elif (B - A) % 2 == (C - A) % 2 == 1:
    print((B - A) // 2 + (C - A) // 2 + 1)
else:
    print((B - A) // 2 + (C - A) // 2 + 2)

Submission status: Wrong Answer

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

D = sorted([A,B,C])

count = int((D[2] - D[0])/2) + int((D[2] - D[1])/2)
E = (D[2] - D[0])%2 + (D[2] - D[0])%2

if E == 2:
    count += 1
elif E == 1:
    count += 2

print(count)

Submission status: Wrong Answer

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

D = sorted([A,B,C])

count = int((D[2] - D[0])/2) + int((D[2] - D[0])/2)
if (D[2] - D[0])%2 + (D[2] - D[0])%2 == 2:
    count += 1
else:
    count += 2

print(count)

Submission status: Wrong Answer

Solution code:
import numpy as np

queue = [( 0, np.array([ int(n) for n in input().split() ]) )]

while queue:
    c, now = queue.pop(0)

    if now[0] == now[1] == now[2]:
        print(c)
        break

    if(np.max(now)-np.min(now) > 10):
        now[np.argmin(now)] += 2
        queue.append((c+1, now))
    else:
        queue.extend([ (c+1, now+x) for x in ([1, 1, 0], [1, 0, 1], [0, 1, 1], [0, 0, 1], [0, 1, 0], [1, 0, 0]) ])

Submission status: Wrong Answer

Solution code:
import numpy as np

queue = [( 0, np.array([ int(n) for n in input().split() ]) )]

while queue:
    c, now = queue.pop(0)

    if now[0] == now[1] == now[2]:
        print(c)
        break

    if(np.max(now)-np.min(now) > 2):
        now[np.argmin(now)] += 2
        queue.append((c+1, now))
    else:
        queue.extend([ (c+1, now+x) for x in ([1, 1, 0], [1, 0, 1], [0, 1, 1], [0, 0, 1], [0, 1, 0], [1, 0, 0]) ])

Submission status: Wrong Answer

Solution code:
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

x = read_line(int, int, int)
x = list(x)
x.sort(reverse=True)


def isodd(n):
    return n % 2 == 0

count = 0

for p in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
    if isodd(x[p[0]]) and isodd(x[p[1]]) and not isodd(x[p[2]]):
        x[p[0]] += 1
        x[p[1]] += 1
        count += 1

x.sort(reverse=True)

count += (x[0] - x[1]) / 2
count += (x[0] - x[2]) / 2

print(int(count))

Submission status: Wrong Answer

Solution code:
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

x = read_line(int, int, int)
x = list(x)
x.sort(reverse=True)


def isodd(n):
    return n % 2 == 0

count = 0

for p in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
    if isodd(x[p[0]]) and isodd(x[p[1]]) and not isodd(x[p[2]]):
        x[p[0]] += 1
        x[p[1]] += 1
        count += 1
x.sort(reverse=True)

count += (x[1] - x[0]) / 2
count += (x[2] - x[0]) / 2

Submission status: Wrong Answer

Solution code:
import numpy as np

queue = [np.array([ int(n) for n in input().split() ] + [0])]

while queue:
    now = queue.pop(0)

    if now[0] == now[1] == now[2]:
        print(now[3])
        break

    min = np.argmin(now[:3])
    
    if(np.max(now[:3])-np.min(now[:3]) > 2):
        now[min] += 2
        now[3] += 1
        queue.append(now)

    else:
        queue.append(now+[1, 1, 0, 1])
        queue.append(now+[1, 0, 1, 1])
        queue.append(now+[1, 1, 0, 1])
        queue.append(now+[0, 1, 1, 1])
        queue.append(now+[1, 0, 1, 1])
        queue.append(now+[0, 1, 1, 1])

Submission status: Wrong Answer

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

gu = filter(lambda x: x%2==0 ,li)
ki = filter(lambda x: x%2!=0 ,li)

if len(ki) == 1:
    gu = map(lambda x:x+1 , gu)
    maxx = max(ki+gu)
    re = map(lambda x:(maxx-x)/2 ,ki+gu)
    print sum(re)+1

if len(gu) == 1:
    ki = map(lambda x:x+1 , ki)
    maxx = max(ki+gu)
    re = map(lambda x:(maxx-x)/2 ,ki+gu)
    print sum(re)+1


if len(ki) == 3:
    maxx = max(ki+gu)
    re = map(lambda x:(maxx-x)/2 ,ki+gu)
    print sum(re)+1


if len(gu) == 3:
    maxx = max(ki+gu)
    re = map(lambda x:(maxx-x)/2 ,ki+gu)
    print sum(re)+1

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
a = [0,0,0]
s = input().split()
a[0] = int(s[0])
a[1] = int(s[1])
a[2] = int(s[2])

#a_min = min(a)
#a[0] -= a_min
#a[1] -= a_min
#a[2] -= a_min

count = 0
while(True):
    if a[0] == a[1] and a[1] == a[2]:
        #print(count)
        break
    a.sort()
    if a[2] >= a[0]+2:
        a[0] += 2
        count += 1
    elif a[2] == a[1] +1:
        a[2] -= 1
        count += 1
    elif a[1] == a[0] +1:
        a[1] -= 1
        count += 1
    elif a[1] == a[0] +1:
        a[1] -= 1
        count += 1
    print(a)
print(count)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if (a - b) % 2 == (b - c) % 2:
	print((a - b) // 2 + (b - c) // 2)
else:
    print((a - b) // 2 + (b - c) // 2 + 2)

Submission status: Wrong Answer

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

    print(solve(a, b, c))


def solve(a, b, c):
    a, b, c = sorted([a, b, c])
    x = a % 2
    y = b % 2
    z = c % 2

    print(a, b, c)

    if x == y == z:
        return (c - a) // 2 + (c - b) // 2
    
    if x == y:
        return solve(a + 1, b + 1, c) + 1
    
    if x == z:
        return solve(a + 1, b, c + 1) + 1
    
    if y == z:
        return solve(a, b + 1, c + 1) + 1


def evens(*args):
    n = 0
    for i in args:
        if i % 2 == 0:
            n += 1
    return n

main()