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

Solution (Python):
A=[int(x) for x in input().split()]
A.sort()

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

Solution (Python):
def main():
    ABC = tuple(map(int, input().split()))

    abc = sorted(ABC)
    cnt = abc[2] - abc[1]
    abc = [abc[0] + cnt, abc[1] + cnt, abc[2]]
    n = abc[1] - abc[0]
    if n % 2:
        cnt += -(-n // 2) + 1
    else:
        cnt += n // 2

    print(cnt)

main()

Solution (Python):
A,B,C = map(int, input().split())
o1 = min(A,B,C)
o3 = max(A,B,C)
o2 = A + B + C - o1 - o3

count = 0 
count += o3 - o2
o2 += count 
o1 += count


count += (o2 - o1)//2
o1 += ((o2 - o1)//2)*2

if (o1 == o2) :
	print (count)
else :
	print (count + 2)

Solution (Python):
abc = list(map(int, input().split()))
abc.sort()
count = 0
count += int((abc[2]-abc[1])/2)
abc[1] += 2*int((abc[2]-abc[1])/2)

count += int((abc[2]-abc[0])/2)
abc[0] += 2*int((abc[2]-abc[0])/2)

if abc[2]*3-sum(abc) == 1:
	count += 2
elif abc[2]*3-sum(abc) == 2:
	count += 1

print(count)

Solution (Python):
smallest, medium, biggest = sorted(map(int, input().split()))
ops_1 = biggest - medium
ops_2 = (biggest - (smallest + ops_1)) // 2
rest = 2 * ((biggest - (smallest + ops_1)) % 2)
print(ops_1 + ops_2 + rest)

Solution (Python):
number_list = list(map(int,input().split()))

number_list.sort()

a = number_list[0]
b = number_list[1]
c = number_list[2]
counter = 0

if (b-a)%2==0:
    counter += (b-a)/2
    counter += (c-b)
    print(int(counter))

else:
    a = a + 1
    c = c + 1
    counter += (b-a)/2
    counter += (c-b)
    print(int(counter+1))

Solution (Python):
num=list(map(int,input().split()))
num.sort()
a,b,c=num[0],num[1],num[2]

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

Solution (Python):

import math

if __name__ == "__main__":
    """
    操作1：２つを選んで、その両方を+1する
    操作2：１つを選んで、その数字を+2する
    """
    nums = list(map(int, input().split()))
    
    

    
    nums.sort()
    A = nums[0]
    B = nums[1]
    C = nums[2]
    ans = 0
    n = C - B 
    A += n
    B += n
    ans += n

    
    diff = C - A
    if diff%2 != 0:
        C += 1
        B += 1
        ans += 1 
    diff = C - A
    ans += math.floor(diff/2)
    print(ans)

Solution (Python):
a,b,c = map(int,input().split())
max = max(a,b,c)
min = min(a,b,c)
sec = a+b+c-max-min
if ((max-min)+(max-sec)) % 2 == 0:
	print( ((max-min)+(max-sec))//2 )
else:
	print( ((max-min)+(max-sec)+3)//2 )

Solution (Python):
def main():
    A,B,C = map(int, input().split())

    f(A,B,C)


def f(A,B,C):
    """
    A: 545, 565, 666 ans=2
    B: 445,      555 ans=1
    C: 123, 233, A pattern ans=3
    D: 135, 245, 355, 555 ans=3
    E: 235, 345, 455, A pattern ans=4
    """
    A, B, C = sorted([A, B, C])
    ans = 0
    if B != C:
        ans += C - B
        B = C
        A += ans
    
    diff = B - A
    ans += diff // 2
    if diff % 2 != 0:
        
        ans += 2

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
List = list(map(int,input().split()))

judge = 3*max(List) - sum(List)

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

Solution (Python):
a = list(map(int, input().split()))
a.sort()
b = (a[2]-a[0])//2
c = (a[2]-a[1])//2

if (a[2]-a[0])%2 == 0 and (a[2]-a[1])%2 == 0:
    print(b+c)
if (a[2]-a[0])%2 != 0 and (a[2]-a[1])%2 != 0:
    print(b+c+1)
if (a[2]-a[0])%2 == 0 and (a[2]-a[1])%2 != 0:
    print(b+c+2)
if (a[2]-a[0])%2 != 0 and (a[2]-a[1])%2 == 0:
    print(b+c+2)

Solution (Python):
A = list(map(int, input().split()))
t=0


while max(A)-min(A)>1:
    x = min(A)
    A.remove(x)
    A.append(x+2)
    t += 1

P = A.count(max(A))
if P == 1:
    t+=1
elif P == 2:
    t += 2

print(t)

Solution (Python):
import sys

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    L = [int(input_raw[0]), int(input_raw[1]), int(input_raw[2])]
    L.sort()
    Min = L[0]
    Mid = L[1]
    Max = L[2]
    s = (Max - Mid)/2
    s += (Max - Min)/2
    if (Max - Mid)%2 != 0 and (Max - Min)%2 != 0:
        s += 1
    elif (Max - Mid)%2 != 0 or (Max - Min)%2 != 0:
        s += 2

    print s



if __name__ == '__main__':
    main()

Solution (Python):
a, b, c = sorted([int(x) for x in input().split()])

xb = (c - b) // 2
b += xb * 2
xa = (c - a) // 2
a += xa * 2

x = xa + xb
if a == b and b == c:
    print(x)
elif a < c and b < c:
    print(x + 1)
else:
    print(x + 2)

Solution (Python):
a, b, c = map(int, input().split())
d = [a, b, c]
d.sort()

count = 0

while d[2] > d[1]:
    d[1] += 1
    d[0] += 1
    count += 1

while d[0] < d[1]-1:
    d[0] += 2
    count += 1

if d[0] == d[1]:
    print(count)
else:
    print(count+2)

Solution (Python):
A = sorted(list(map(int, input().split())))
ans = 0

while len(set(A))>1:
    if A[2] > A[0]+1:
        A[0] += 2
    elif A[1] == A[2] and A[0] == A[1]-1:
        A[1] += 1
        A[2] += 1
    elif A[0]== A[1] and A[1] == A[2]-1:
        A[0] += 1
        A[1] += 1
    elif A[0] < A[1]:
        A[0] += 2
    ans += 1
    A.sort()

print(ans)

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


dA = C - A
dB = C - B

ans = 0
if dA%2==0 and dB%2!=0:
    A += 1
    C += 1
    ans += 1
elif dA%2!=0 and dB%2==0:
    B += 1
    C += 1
    ans += 1
elif dA%2!=0 and dB%2!=0:
    A += 1
    B += 1
    ans += 1

dA = C - A
dB = C - B
ans += dA//2 + dB//2

print(ans)

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

M = max(a, b, c)
s = sum([M-x for x in [a, b, c]])
if s&1:
    s += 3

print(s//2)

Solution (Python):
import numpy as np

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

m = max((a, b, c))

s = m - a + m - b + m - c

if(s % 2 == 1):
    s += 3

print(int(s/2))

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

S = A + B + C
D = max(A, B, C)
S_ = S
while True:
    if S_ % 3 == 0:
        E = S_ // 3
        if E >= D:
            F = 3*E - A - B - C
            if F % 2 == 0:
                ans = F // 2
                break
    S_ += 2

print(ans)

Solution (Python):
a = list(map(int, input().split()))
cnt = 0


while not(a[0] == a[1] == a[2]):
    a.sort()
    if a[2] - a[0] >= 2:
        a[0] += 2
        cnt += 1


    elif a[2] - a[0] >= 1 or a[2] - a[1] >= 1:
        a.sort()
        a[0] += 1
        a[1] += 1
        cnt += 1

print(cnt)

Solution (Python):
if __name__ == '__main__':
    A, B, C = map(int, input().split())

    max_value = max(A, B, C)
    diff_sum = sum([max_value - v for v in [A, B, C]])

    if diff_sum % 2 == 0:
        print(diff_sum // 2)
    else:
        print((diff_sum + 3) // 2)

Solution (Python):


import numpy as np

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


maxl = max(A,B,C)
diff = [maxl-A,maxl-B,maxl-C]

diff = sorted(diff)

count = 0

count += diff[1]
diff[2] -= diff[1]

count += int(diff[2]/2)
diff[2] = diff[2]%2

if diff[2] == 1:
	count += 2

print(int(count))

Solution (Python):
a, b, c = map(int, input().split())
x = max(a+b+c, 3*max(a, b, c))
y = (x//3 + (x%3>0))*3 
if (a+b+c)%2 != y%2:
  y += 3
print((y-(a+b+c))//2)

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

if a > b:
    d = a
    a = b
    b = d
    
if b > c:
    d = b
    b = c
    c = d
   
if a > b:
    d = a
    a = b
    b = d 


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

print(ans)

Solution (Python):
s = [int(x) for x in input().split()]
s.sort()
cnt = 0

tmp = abs(s[0] - s[1])
if tmp % 2 == 0:
    cnt += tmp // 2
else:
    cnt += tmp // 2 + 1
    s[2] += 1

print(cnt+s[2]-s[1])

Solution (Python):
a, b, c = map(int, input().split())
maxnum = max(a,b,c)
amari = 3 * maxnum - (a + b + c)
if amari % 2 == 0:
    print(amari//2)
else:
    print((amari-3)//2 + 3)

Solution (Python):
l = list(map(int, input().split()))
count = 0
while True:
  l.sort()
  if l[0] == l[1] and l[1] == l[2]:
    break

  if l[0] < l[1] and l[1] == l[2]:
    l[0] += 2
    count += 1
  else:
    l[0] += 1
    l[1] += 1
    count += 1

print(count)

Solution (Python):
a = list(map(int, input().split()))
a.sort()
b = 0
b = b + (a[2] - a[1]) // 2
b = b + (a[2] - a[0]) // 2
if (a[2] - a[1]) % 2 == 0 and (a[2] - a[0]) % 2 == 0:
    pass
if (a[2] - a[1]) % 2 == 1 and (a[2] - a[0]) % 2 == 0:
    b = b + 2
if (a[2] - a[1]) % 2 == 0 and (a[2] - a[0]) % 2 == 1:
    b = b + 2
if (a[2] - a[1]) % 2 == 1 and (a[2] - a[0]) % 2 == 1:
    b = b + 1
print(b)

Solution (Python):
count = 0
abclist = [int(x) for x in input().split()]
abclist = sorted(abclist)
while(abclist[1] - abclist[0] >= 2):
    abclist[0] += 2
    count += 1
while(abclist[1] - abclist[0] == 1):
    abclist[0] += 1
    abclist[2] += 1
    count += 1
while(abclist[2] - abclist[1] > 0):
    abclist[0] += 1
    abclist[1] += 1
    count += 1
print(count)

Solution (Python):

num = list(map(int,input().split()))
num.sort()

ans = int((num[2] - num[1])/2)
num[1] += ans*2
ans += int((num[2]- num[0])/2)
num[0] += int((num[2]- num[0])/2)*2
num.sort()

if num[0] == num[1] and num[1] == num[2]:
	print(ans)
elif num[0] == num[1]:
	print(ans+1)
else:
	print(ans+2)

Solution (Python):
a, b, c = map(int, input().split())
p, q = divmod(3*max(a, b, c) - a - b - c, 2)
print(p + 2*q)

Solution (Python):
nums = [int(_) for _ in input().split()]
nums.sort()
ans = 0

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

Solution (Python):
a = map(int,raw_input().split())
a.sort()

count = 0

d = [0,0]

d[0] = a[2] - a[1]
d[1] = a[2] - a[0]
d.sort()

while d[0] != 0:
  d[0] -= 1
  d[1] -= 1 
  count += 1

if d[1] == 0:
  print count
  exit(0)

if d[1] % 2 == 1:
  d[1] += 1
  count += 1

count += d[1]/2
print count

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

Solution (Python):
a, b, c = map(int, input().split())
rec = sorted([a, b, c])
if (a % 2 == 0 and b % 2 == 0 and c % 2 == 0) or (a % 2 != 0 and b % 2 != 0 and c % 2 != 0):
    print((rec[2] * 2 - rec[1] - rec[0]) // 2)
elif a % 2 == 0 and b % 2 == 0 and c % 2 != 0:
    a, b = a + 1, b + 1
    rec = sorted([a, b, c])
    print((rec[2] * 2 - rec[1] - rec[0]) // 2 + 1)
elif a % 2 != 0 and b % 2 == 0 and c % 2 == 0:
    c, b = c + 1, b + 1
    rec = sorted([a, b, c])
    print((rec[2] * 2 - rec[1] - rec[0]) // 2 + 1)
elif a % 2 == 0 and b % 2 != 0 and c % 2 == 0:
    a, c = a + 1, c + 1
    rec = sorted([a, b, c])
    print((rec[2] * 2 - rec[1] - rec[0]) // 2 + 1)
elif a % 2 != 0 and b % 2 != 0 and c % 2 == 0:
    a, b = a + 1, b + 1
    rec = sorted([a, b, c])
    print((rec[2] * 2 - rec[1] - rec[0]) // 2 + 1)
elif a % 2 == 0 and b % 2 != 0 and c % 2 != 0:
    c, b = c + 1, b + 1
    rec = sorted([a, b, c])
    print((rec[2] * 2 - rec[1] - rec[0]) // 2 + 1)
elif a % 2 != 0 and b % 2 == 0 and c % 2 != 0:
    a, c = a + 1, c + 1
    rec = sorted([a, b, c])
    print((rec[2] * 2 - rec[1] - rec[0]) // 2 + 1)

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

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

count = 0

while(1):
    
    if a == b == c:
        break
    if a == b and b < c:
        a += 1
        b += 1
        count += 1
    elif b == c and c < a:
        b += 1
        c += 1
        count += 1
    elif c == a and a < b:
        c += 1
        a += 1
        count += 1
    else:
        if a == min(a,b,c):
            a += 2
            count += 1
        elif b == min(a,b,c):
            b += 2
            count += 1
        elif c == min(a,b,c):
            c += 2
            count += 1
print(count)

Solution (Python):
a,b,c = sorted(map(int, input().split(" ")))
sum = c-b
a += c-b
if (c-a)%2 == 0:
    sum += (c-a)//2
else:
    sum += (c+3-a)//2
print(sum)

Solution (Python):
s = input().split(" ")
s = [int(i) for i in s]
s = sorted(s)
Max = s[2]
Med = s[1]
Min = s[0]

count = Max - Med
left = (Max - Min - count) 
if left % 2 == 1 : 
    count += (left+1)/2 + 1
else : 
    count += left/2
print(int(count))

Solution (Python):
num = list(map(int, input().split()))

maximum = max(num)
dif = [maximum - n for n in num]

counter = 0
odd = 0
for d in dif:
    q, r = divmod(d, 2)
    counter += q
    odd += r

if odd == 0:
    pass
elif odd == 1:
    counter += 2
else:
    counter += 1

print(counter)

Solution (Python):
A,B,C = [int(x) for x in input().split()]
D = max(A,B,C)
ans = 0

ans += (D-A)//2
A += 2*((D-A)//2)
ans += (D-B)//2
B += 2*((D-B)//2)
ans += (D-C)//2
C += 2*((D-C)//2)

if max(A,B,C) != (A+B+C)/3:
    if A+B+C+1 == max(A,B,C)*3:
        ans +=2
    else:
        ans +=1

print(ans)

Solution (Python):


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

d = max(A, B, C)
t = d*3 - (A + B + C)

print t / 2 if t % 2 == 0 else (t + 3) / 2

Solution (Python):
if __name__ == '__main__':
    nums = sorted(list(map(int, input().split())))

    ans = 0
    l_s = nums[2] - nums[0]
    l_m = nums[2] - nums[1]
    ans += l_s // 2 + l_m // 2
    nums[0] += 2 * (l_s // 2)
    nums[1] += 2 * (l_m // 2)

    
    
    if nums[0] == nums[1] and nums[0] == nums[2]:
        print(ans)
    elif nums[0] == nums[1] and nums[1] != nums[2]:
        print(ans + 1)
    else:
        print(ans + 2)

Solution (Python):
A,B,C = map(int,input().split())
ans = 0
if ((A+B+C)-max(A,B,C))%2 == 0:
    ans = (max(A,B,C)*3-(A+B+C))//2
else:
    ans = (max(A,B,C)*3-(A+B+C))//2 + 2
print(ans)

Solution (Python):


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

value_max = max(a, b, c)

diff = 0
for z in [a, b, c]:
    diff += value_max - z

res = 0
if diff % 2 == 0:
    res = diff // 2
else:
    res = diff // 2 + 2

print(res)

Solution (Python):
n=list(map(int,input().split()))
n.sort()
c=0
while True:
    if(n[0]==n[1] and n[0]==n[2]):
        break
    if(n[0]==n[1]):
        n[0]+=1
        n[1]+=1
    else:
        n[0]+=2
    n.sort()
    c+=1
print(c)

Solution (Python):
def inpl(): return list(map(int, input().split()))
a = inpl()
a = sorted(a)

mid_count, min_count = (a[2]-a[1])//2, (a[2]-a[0])//2

if a[0]+min_count*2==a[1]+mid_count*2:
    if a[0]+min_count*2==a[2]:
        diff = 0
    else:
        diff = 1
else:
    diff = 2

print(mid_count+min_count+diff)

Solution (Python):
abc = list(map(int, input().split()))
count = 0
while abc[0] != abc[1] or abc[1] != abc[2] or abc[2] != abc[0]:
    abc = sorted(abc)
    if len(set(abc)) == 2:
        if abc[0] == abc[1]:
            abc[0] += 1
            abc[1] += 1
        else:
            abc[0] += 2
    else:
        abc[0] += 1
        abc[1] += 1
    count += 1
print(count)

Solution (Python):

a, b, c = map(int, input().split(" "))
count = 0
while min(a, b, c) < max(a, b, c):
    if max(a, b, c) - min(a, b, c) > 1:
        count += 1
        if a == min(a, b, c):
            a += 2
        elif b == min(a, b, c):
            b += 2
        elif c == min(a, b, c):
            c += 2
    else:
        num = 0
        for i in [a, b, c]:
            if i == max(a, b, c):
                num += 1
        if num == 1:
            count += 1
        else:
            count += 2
        break
print(count)

Solution (Python):
arr=list(map(int, input().split(" ")))
arr=sorted(arr)
diff=arr[2]-arr[1]+arr[2]-arr[0]
if diff%2==0:
    print(int(diff/2))
else:
    print(int((diff+3)/2))

Solution (Python):
a,b,c=list(map(int,input().split()))
mi=min([a,b,c])
ma=max([a,b,c])
mid=a+b+c-mi-ma
ans=0

if (mid-mi)%2==1:
  ans+=1
  ma+=1
  mi+=1
  ans+=(mid-mi)/2
  ans+=ma-mid
else:
  ans+=(mid-mi)/2
  ans+=ma-mid

print(int(ans))

Solution (Python):
int_list = list(map(int, input().split(' ')))

max_int = max(int_list)

cnt = 0
for i in range(3):
    if i < max_int:
        cnt_tmp = (max_int - int_list[i]) // 2
        int_list[i] += 2 * cnt_tmp
        cnt += cnt_tmp

min_int = min(int_list)
int_list2 = sorted([i - min_int for i in int_list])

if int_list2 == [0, 0, 0]:
    print(cnt)
elif int_list2 == [0, 0, 1]:
    print(cnt + 1)
else:
    print(cnt + 2)

Solution (Python):
l=list(map(int,input().split()))
l.sort()
a=l[2]-l[1]
b=l[2]-l[0]
if(a%2==0 and b%2==0):
    print(a//2+b//2)
elif(a%2==1 and b%2==1):
    print(a//2+b//2+1)
else:
    print(a//2+b//2+2)

Solution (Python):
A = sorted([int(x) for x in input().split()])
count = 0
for x in range(A[2] - A[1]):
 count += 1
 A[0] += 1
 A[1] += 1
for x in range((A[2] - A[0])//2):
 count += 1
 A[0] += 2
print(count if A.count(A[0]) == 3 else count+2)

Solution (Python):


N = map(int, raw_input().split())
N.sort()

a,b,c = tuple(N)


cnt = 0




d1 = c - a
d2 = c - b

i = d1 / 2
d1 = d1 - i * 2

cnt += i

j = d2 / 2
d2 = d2 - j * 2

cnt += j

if d1 == d2 == 0:
    print cnt

elif d1 == d2 == 1:
    print cnt + 1
else:
    print cnt + 2

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

d = sorted([A, B, C], reverse=True)
parity = (A + B + C) % 2

if (parity == 0 and d[0] % 2 == 1) or (parity == 1 and d[0] % 2 == 0):
    goal = d[0] + 1
else:
    goal = d[0]

print((goal * 3 - (A + B + C)) // 2)

Solution (Python):
A, B, C = map(int, input().split())
a = max(A, B, C)
c = min(A, B, C)
b = (A + B + C) - (a + c)

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

print(ans)

Solution (Python):
line = list(map(int,input().split()))

line.sort()

large = line[2]

board = 3*large

total = sum(line)

while (board-total)%2 !=0:
    board += 3

print(int((board-total)/2))

Solution (Python):
A,B,C=map(int,input().split())
a,b,c = 0,0,0
total = A+B+C
count = 0
while 1:
    a = max(A,B,C)
    c = min(A,B,C)
    b = total - (a+c)
    if a == b and b==c:
        break
    elif a == b and b > c:
        c += 2
    elif a > b and b == c:
        b += 1
        c += 1
    else:
        b += 1
        c += 1
    count += 1
    A = a
    B = b
    C = c
    total = A+B+C
print(count)

Solution (Python):
a,b,c = map(int,input().split(" "))
sum = a+b+c
max = max(a,b,c)
if (sum - max)%2 == 0:
    print(int((max*3 - sum)/2))
else:
    print(int(((max+1)*3 - sum)/2))

Solution (Python):
A = list(map(int, input().split()))
M = max(A)
r = sum([M - i for i in A])

if r % 2 == 0:
    print(r // 2)
else:
    print((r + 3) // 2)

Solution (Python):
a,b,c=map(int,input().split())
ans=0
s=[a,b,c]
s=sorted(s)
x=s[2]-s[0]
y=s[2]-s[1]
if x%2==y%2:
    print((x+y)//2)
else:
    print(1+(x+y+1)//2)

Solution (Python):
A,B,C = map(int, input().split())
a = max(A,B,C)*3-sum([A,B,C])
if a %2 == 0:
    print(a//2)
else:
    print((a+3)//2)

Solution (Python):
a, b, c = map(int,input().split())
P = [0, 0, 0]
ans = 0

if a % 2 == 1:
    P[0] = 1
if b % 2 == 1:
    P[1] = 1
if c % 2 == 1:
    P[2] = 1

s = P.count(1)

if s == 1:
    ans += 1
    if P[0] == 0:
        a += 1
    if P[1] == 0:
        b += 1
    if P[2] == 0:
        c += 1
elif s == 2:
    ans += 1
    if P[0] == 1:
        a += 1
    if P[1] == 1:
        b += 1
    if P[2] == 1:
        c += 1

ans += (max(a, b, c) - a) // 2
ans += (max(a, b, c) - b) // 2
ans += (max(a, b, c) - c) // 2

print(ans)

Solution (Python):

"""
C - Same Integers
https://beta.atcoder.jp/contests/abc093/tasks/arc094_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(numbers):
    ans = 0
    while numbers[0] != numbers[1] or numbers[0] != numbers[2]:
        numbers.sort()
        if numbers[0] + 2 <= numbers[2]:
            numbers[0] += 2
            ans += 1
        else:
            numbers[0] += 1
            numbers[1] += 1
            ans += 1
    return ans


def main(args):
    numbers = [int(x) for x in input().split()]
    ans = solve(numbers)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

m = max(A, B, C)
diff = [m - A, m - B, m - C]
s = sum(diff)
if s % 2 == 0:
    print(s // 2)
else:
    print((s + 3) // 2)

Solution (Python):
a,b,c = (int(i) for i in input().split())
x,answer = [a,b,c],0
x.sort()
y = x[2]-x[1]
x[0] = x[0]+y
if (x[2]-x[0])%2==0:
	print(y+(x[2]-x[0])//2)
else:
	print(y+(x[2]-x[0]+3)//2)

Solution (Python):
f = lambda :[int(i) for i in input().split()]
from sys import stderr
debug = lambda x:stderr.write(repr(x)+'\n')

a,b,c = sorted(f())
ans = 0
while a < b:
    a += 2
    ans += 1
if b < a:
    b += 1
    c += 1
    ans += 1
while b < c:
    a += 1
    b += 1
    ans += 1
print(ans)

Solution (Python):
lis = list(map(int,input().split()))
cou = 0
lis.sort()
while lis[2] - lis[0] > 1:
    lis[0] +=2
    cou += 1
    lis.sort()
if lis[0] == lis[1] and lis[1] == lis[2]:
    print(cou)
elif lis[1] == lis[2]:
    print(cou + 2)
else:
    print(cou + 1)