Problem:


Score : 100 points

Problem Statement

You have three tasks, all of which need to be completed.

First, you can complete any one task at cost 0.

Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.

Here, |x| denotes the absolute value of x.

Find the minimum total cost required to complete all the task.

Constraints

All values in input are integers.

1 \leq A_1, A_2, A_3 \leq 100

Input

Input is given from Standard Input in the following format:

A_1 A_2 A_3

Output

Print the minimum total cost required to complete all the task.

Sample Input 1

1 6 3

Sample Output 1

5

When the tasks are completed in the following order, the total cost will be 5, which is the minimum:

Complete the first task at cost 0.

Complete the third task at cost 2.

Complete the second task at cost 3.

Sample Input 2

11 5 5

Sample Output 2

6

Sample Input 3

100 100 100

Sample Output 3

0



Sample input:
1 6 3


Sample output:
5

Submission status: Wrong Answer

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

if abs(a - c) < abs(a - b):
    print(abs(a - c) + abs(c - b))
elif abs(a - c) > abs(a - b):
    print(abs(a - b) + abs(b - c))

Submission status: Wrong Answer

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

if abs(a - c) < abs(a - b):
    print(abs(a - c) + abs(c - b))
elif abs(a - c) < abs(a - b):
    print(abs(a - b) + abs(b - c))

Submission status: Wrong Answer

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

if abs(a - c) < abs(a - b):
    print(abs(a - c) + abs(c - b))
elif abs(a - b) < abs(b - c):
    print(abs(a - b) + abs(b - c))

Submission status: Wrong Answer

Solution code:
#103
A =[int(j) for j in input().split()]
print(abs(A[2]-A[0]))

Submission status: Wrong Answer

Solution code:
task = list(map(int, input().split()))
cost = 0
for i in range(2):
  cost += task[i+1] - task[i]
print(cost)

Submission status: Wrong Answer

Solution code:
A = [int(i) for i in input().split()]
for i in range(3):
  if i ==2:
    A[i] = abs(A[i] - A[0])
  else:
    A[i] = abs(A[i]-A[i+1])
print(sum(A) - max(A))

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
count = 1000
num = 0


for i in a:
    for j in a:
        for k in a:
            num = abs(j-i)+abs(k-j)
            if count>num:
                count = num

print(count)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
count = 1000
num = 0


for i in a:
    for j in a:
        for k in a:
            num = abs(j-i)+abs(k-j)
            if count>num:
                count = num

print(num)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, raw_input().split())
d = a
z = a
if d < b:
    d = b
elif d < c:
    d = c
if z > b:
    z = b
elif z > c:
    z = c
print d - z

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
x=0
x+=min(abs(a-b),abs(a-c))
x+=abs(b-c)
print(x)

Submission status: Wrong Answer

Solution code:
A=input().split()
A.sort()
print(eval(A[2]+"-"+A[0]))

Submission status: Wrong Answer

Solution code:
A=input().split().sort()
print(A)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
A = map(int, input().split())
A = sorted(A)
print(A[1] - A[0] + A[2] - A[0])

Submission status: Wrong Answer

Solution code:
A, B, C = [int(x) for x in input().split()]
if abs(C-A) < abs(B-A):
    print(abs(C-A)+(B-C))
else:
    print(abs(B-A)+(B-C))

Submission status: Wrong Answer

Solution code:
A, B, C = [int(x) for x in input().split()]
print(abs(C-A)+(B-C))

Submission status: Wrong Answer

Solution code:
a=list(map(int, input().split()))
a.sort(reverse=True)
print(a[2]-a[0])

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
ans = abs(a-b) + abs(b-c) + abs(a-c) - max(abs(a-b), abs(b-c), abs(b-a))
print(ans)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()));a.sort()
print(max(a[2]-a[1]*2-a[0],0))

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()));a.sort()
print(a[2]-a[1]*2-a[0])

Submission status: Wrong Answer

Solution code:
# coding: utf-8
A = sorted(list(map(int, input().split())))
print(A[2] - A[1] - A[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list1 = [int(a) for a in input().split()]
list1_0 = list1[0] #A1
list1_1 = list1[1] #A2
list1_2 = list1[2] #A3

list2 = [list1_0, list1_1, list1_2]
list2.sort()
b = max(list2) - list2[1]
c = b - min(list2)
print(b + c)

Submission status: Wrong Answer

Solution code:
a1, a2, a3 = map(int, input().split())

cost1 = abs(a1 - a2) + abs(a2 - a3)
cost2 = abs(a1 - a3) + abs(a3 - a2)

print(cost1 if cost1 < cost2 else cost2)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print(min(a+abs(b-a)+abs(c-b),a+abs(c-a)+abs(b-c),b+abs(a-b)+abs(c-a),b+abs(c-b)+abs(a-c),c+abs(a-c)+abs(b-a),c+abs(b-c)+abs(a-b)))

Submission status: Wrong Answer

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

l = list(map(int, input().split()))
print(3*max(l)-sum(l))

Submission status: Wrong Answer

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

l = list(map(int, input().split()))
print(sum(l)-max(l))

Submission status: Wrong Answer

Solution code:
L=[int(i) for i in input().split()]
S=[L[1]+abs(L[2]-L[1]),L[2]+abs(L[2]-L[1]),L[2]+abs(L[2]-L[0]),L[0]+abs(L[2]-L[0]),L[0]+abs(L[0]-L[1]),L[1]+abs(L[0]-L[1])]
print(min(S))

Submission status: Wrong Answer

Solution code:
task=list(map(int,input().split(" ")))
print(task)
task.sort()
print(task)
cost=0

for i in range(len(task)-1):
    cost+=task[i+1]-task[i]
print(cost)

Submission status: Wrong Answer

Solution code:
a1, a2, a3 = map(int, input().split())

totalCost = 0

Cost = [abs(a1 - a2), abs(a2 - a3), abs(a1 - a3)]
Cost.sort()

totalCost = Cost[0] + Cost[1]

Submission status: Wrong Answer

Solution code:
import sys

def main():
  input = sys.stdin.readline
  A = list(map(int, input().split()))
  A = sorted(A)
  ans = 0
  for i in range(1, len(A)-1):
    ans += A[i+1] - A[i]
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
li = list(map(int, input().split()))
li.sort()
print(li[0]-li[2])

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
a.sort()
print(a)
print(a[2]-a[0])

Submission status: Wrong Answer

Solution code:
a, b, c = map(int,input().split())
A = []
A.append(a)
A.append(b)
A.append(c)
A.sort()
print(A)
print((A[1]-A[0])+(A[2]-A[1]))

Submission status: Wrong Answer

Solution code:
A1, A2, A3 = map(int,input().split())
if A1>A2>A3:
    print(A1-A3)
elif A3>A2>A1:
    print(A3-A1)
elif A2>A1>A3:
    print(A2-A3)
elif A3>A1>A2:
    print(A3-A2)
elif A2>A3>A1:
    print(A2-A1)
else:
    print(A1-A2)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
print(min(abs(a-b)+abs(a-c),abs(b-a)+(b-c),abs(c-a)+abs(c-b)))

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a>c or a>b:
    if c>b:
        print(abs(a-b))
    else:
        print(abs(a-c))
elif b>c or b>a:
    if c>a:
        print(abs(b-a))
    else:
        print(abs(b-c))
else:
    if b>a:
        print(abs(c-a))
    else:
        print(abs(c-b))

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if abs(a-b)>abs(a-c) and abs(b-c)>abs(a-c):
    print(abs(a-c)+abs(c-b))
elif abs(a-c)>abs(a-b) and abs(b-c)>abs(a-b):
    print(abs(a-b)+abs(b-c))
else:
    print(abs(b-c)+abs(c-a))

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a!=b and b!=c:
    if abs(a-c)>abs(a-b) and abs(a-c)>abs(b-c):
        print(abs(b-c)+abs(b-c))
    elif abs(a-b)>abs(a-c) and abs(a-b)>abs(b-c):
        print(abs(b-c)+abs(a-c))
    elif abs(b-c)>abs(a-c) and abs(b-c)>abs(a-b):
        print(abs(a-c)+abs(a-b))
elif abs(a)>abs(c):
    print(abs(a-c)+abs(b-c))
else:
    print(abs(a-c)+abs(a-b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a1, a2, a3 = map(int, input().split())
print(abs(a2 - a3) + min(abs(a2 - a1), abs(a3 -a1)))

Submission status: Wrong Answer

Solution code:
a, b, c = sorted(map(int, input().split()), reverse=True)
print(a - c + b - c)

Submission status: Wrong Answer

Solution code:
a, b, c = sorted(map(int, input().split()))
print(a - c + b - c)

Submission status: Wrong Answer

Solution code:
temp = input().rstrip().split(" ")
A1 = int(min(temp))
temp.remove(str(A1))
A2 = int(min(temp))
temp.remove(str(A2))
A3 = int(min(temp))
print(0 + (A2 - A1) + (A3 - A2))

Submission status: Wrong Answer

Solution code:
a=input().split()
[int(a) for a in a]
c=sorted(a)
w=int(c[1])-int(c[0])    
q=int(c[2])-int(c[1])
print(q+w)

Submission status: Wrong Answer

Solution code:
a=input().split()
[int(a) for a in a]
c=sorted(a)
print(c)
w=int(c[1])-int(c[0])    
q=int(c[2])-int(c[1])
print(q+w)

Submission status: Wrong Answer

Solution code:
a=map(int,input().split())
c=sorted(a)
print(c)
w=int(c[1])-int(c[0])    
q=int(c[2])-int(c[1])
print(q+w)

Submission status: Wrong Answer

Solution code:
a=input().split()
c=sorted(a)
w=int(c[0])-int(c[1])    
q=int(c[1])-int(c[2])
print(q+w)

Submission status: Wrong Answer

Solution code:
import sys

def solve(A, B, C):
    # Uncomment the following if you want to check the input.
    i = [A,B,C]
    if A == B and B == C:
        print(0)
    else:
        i.remove(max(A,B,C))
        a,b=i[0],i[1]
        if a - b != 0:
            print(i[0]+i[1]+1)
        else:
            print(i[0]+1)

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    A = int(ws[0])
    B = int(ws[1])
    C = int(ws[2])
    return (A, B, C,)

def main():
    solve(*readQuestion())

# Uncomment before submission
main()

Submission status: Wrong Answer

Solution code:
import sys

def solve(a,b,c):
    f = [a,b,c]
    f.sort()
    #print(f)
    x = 0
    y = 0

    if a == b and b == c :
        return 0
    else:
        x = f[1] - f[0]
        y = f[2] - f[1]
        return x+y

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    a = int(ws[0])
    b = int(ws[1])
    c = int(ws[2])
    return (a, b, c,)

def main():
    solve(*readQuestion())

# Uncomment before submission
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a,b,c = map(int,input().split())#整数の入力
print("{}".format(min(abs(a-b),abs(b-c),abs(c-a)))) #最小値の出力

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
a.sort
ans = (a[2]-a[1])+(a[1]-a[0])
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = abs(b-a) + abs(c-b)
ans = min(ans,b + abs(c-b))
ans = min(ans,a + c)
ans = min(ans,abs(b-a) + b)
print(ans)

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
l = []
for i in range(3):
	for j in range(-3, 0):
		l.append(abs(A[i]-A[j]))
print(min(l))

Submission status: Wrong Answer

Solution code:
a_1,a_2,a_3 = map(int,input().split())
if a_1 > a_2:
    if a_1 > a_3:
        print(abs(a_2-a_3))
    elif a_1 == a_3:
        print(0)
    else:
        print(abs(a_1-a_2))
elif a_1 < a_2:
    if a_1 > a_3:
        print(abs(a_1-a_3))
    elif a_1 == a_3:
        print(0)
    else:
        if a_2 > a_3:
            print(abs(a_1-a_3))
        else:
            print(abs(a_1-a_3))

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
#print(a,b,c)
x=[]
ab=abs(int(b)-int(a))
bc=abs(int(c)-int(b))
ca=abs(int(c)-int(a))
x=[ab,bc,ca]
#print(ab,bc,ca)
#print(x)
x.reverse()
print(x[0]+x[1])

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
A=[a,b,c]
sorted(A)
print(abs(A[0]-A[1])+abs(A[1]-A[2]))

Submission status: Wrong Answer

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

A1 = int(A[1]-A[0])
A2 = int(A[2]-A1)

print(A1+A2)

Submission status: Wrong Answer

Solution code:
a = sorted(input().split())
x = int(a[1])-int(a[0])
y = int(a[2])-int(a[1])
print(x + y)

Submission status: Wrong Answer

Solution code:
A1, A2, A3 = [int(i) for i in sorted(input().split())]
print(A3-A1)

Submission status: Wrong Answer

Solution code:
A1, A2, A3 = [int(i) for i in sorted(input().split())]
print((A1-A3)*-1)

Submission status: Wrong Answer

Solution code:
a = input().split()
a.sort()
print(int(a[2])-int(a[0]))

Submission status: Wrong Answer

Solution code:
print(sum(sorted(list(map(int, input().split())))[:2]))

Submission status: Wrong Answer

Solution code:
cost = 0
a, b, c = (map(int, input().split()))
tasks = [a, b, c]

tasks.remove(max(tasks))
cost += 0

task = min(tasks)
tasks.remove(task)
cost += task

cost += (tasks[0] - task)
print(cost)

Submission status: Wrong Answer

Solution code:
cost = 0
a, b, c = (map(int, input().split()))
tasks = [a, b, c]

tasks.remove(max(tasks))
cost += 0
print(tasks)
task = min(tasks)
tasks.remove(task)
print(task, tasks)
cost += task

cost += (tasks[0] - task)

print(cost)

Submission status: Wrong Answer

Solution code:
cost = 0
a, b, c = (map(int, input().split()))
tasks = [a, b, c]

tasks.remove(max(tasks))
cost += 0

task = min(tasks)
cost += task

cost += tasks[0] - task

print(cost)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from itertools import permutations

a1, a2, a3 = map(int, input().split())
ans = 1e9
for a in permutations([a1, a2, a3]):
    print(a)
    tmp = abs(a[0] - a[1]) + abs(a[1] - a[2])
    ans = min(ans, tmp)
print(ans)

Submission status: Wrong Answer

Solution code:
l = [int(i) for i in input().split()] 
ans = 0
 
for i in range(len(l) - 1):
	if l[i+1] < l[i]:
		tmp = l[i+1]
		l[i+1] = l[i]
		l[i] = tmp
        
for i in range(len(l) - 1):
	ans += l[i+1] - l[i]
    
print(ans)

Submission status: Wrong Answer

Solution code:
[A1,A2,A3]=map(int,input().split())
tasks=[A1,A2,A3]
costs=[]
def cost(start):
    for i in range(3):
        if i!=start:
            cost_1st=abs(tasks[i]-tasks[start])
            for l in range(3):
                if l != i and l != start:
                    total_cost=cost_1st+abs(tasks[i]-tasks[l])
                    costs.append(total_cost)
                else:
                    continue
        else:
            continue
for i in range(3):
    cost(i)
print(costs)
ans=min(costs)

print(ans)

Submission status: Wrong Answer

Solution code:
N, K, L = input().split()
S=int(N)-int(K)
S=abs(S)
I=int(L)-int(K)
I=abs(I)
print(S+I)

Submission status: Wrong Answer

Solution code:
a = input().split()
print(int(max(a)) - int(min(a)))

Submission status: Wrong Answer

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

u = list(set(a))

print(u[-1] - u[0])

Submission status: Wrong Answer

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

if abs(A[0] - A[1]) <= abs(A[0] - A[2]):
    sum +=  abs(A[0] - A[1])
    sum += abs(A[1] - A[2])
else:
    sum += abs(A[0] - A[2])
    sum += abs(A[2] - A[1])
print(sum)

Submission status: Wrong Answer

Solution code:
from statistics import median

task=[int(i) for i in input().split()]
    
b=median(task)
sum=0

for i in range(3):
    sum+=abs(b-task[i])
    
sum

Submission status: Wrong Answer

Solution code:
l= input()
n =l.split()
s = sorted(n)

a1 = int(s[0])
a2 = int(s[1])
a3 = int(s[2])


b1 =(a2 -a1) + (a3 - a2)

b2=(a3 - a1)+(a3 -a2)


b3=(a2 -a1)+(a3 -a1)


c = min(b1,b2,b3)

print(c)

Submission status: Wrong Answer

Solution code:
x=list(map(int,input().split()))
y=sorted(x)
print(y)
print(abs(y[0]-y[1])+abs(y[2]-y[1]))
#print(int(x[3]-x[2]))

Submission status: Wrong Answer

Solution code:
s_i = [int(s_v) for s_v in input().split()]
sum_cost = abs(s_i[1] - s_i[2])
a = abs(s_i[0] - s_i[1])
b = abs(s_i[0] - s_i[2])
if(a >= b):
	sum_cost += b
else:
	sum_cost += a
print(sum_cost)

Submission status: Wrong Answer

Solution code:
import sys

# 1 6 3
s = input().split()
s_i = [int(s_v) for s_v in s]

sum_cost = 0
b = abs(s_i[0] - s_i[1])
c = abs(s_i[0] - s_i[2])
if(b >= c):
    sum_cost += c
    sum_cost += abs(s_i[2] - s_i[1])
else:
    sum_cost += b
    sum_cost += abs(s_i[2] - s_i[1])

print(sum_cost)

Submission status: Wrong Answer

Solution code:
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(repr(item))
        stderr.write(sep)
    stderr.write(end)

a1,a2,a3 = f()

a = abs(a1-a2)
b = abs(a2-a3)
c = abs(a3-a1)
print(min(a,b,c))

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, raw_input().split())
if abs(a-b) > abs(a-c):
    t = b
    b = c
    c = t
cost = (abs(c - b) + abs(b - a))
print(cost)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, raw_input().split())
if abs(a-b) > abs(a-c):
    t = b
    b = c
    c = b
else:
    t=c
    c = b
    b = c
cost = abs((c - b) + (b - a))
print(cost)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
out=abs(a[0]-a[1])
for i in range(3):
    if i ==0:
        b=a[1]
        c=a[2]
    elif i==1:
        b=a[0]
        c=a[2]
    else:
        b=a[0]
        c=a[1]
    if (abs(b-c)<out):
        out=abs(b-c)
    if (abs(c-b)<out):
        out=abs(c-b)
print(out)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n = input()
list = n.split(" ")
max = 0;
min = 0;
for x in list:
    x = int(x)
    if x > max:
        max = x
    elif x < min:
        min = x
    
print(max - min)

Submission status: Wrong Answer

Solution code:
def main():
    task_str = input().split()
    print(task_str)
    task_list = []
    task_list = [int(s, 10) for s in task_str]
    task_list.sort()
    print(task_list)
    result = task_list[2] - task_list[0]
    print(result)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    task_str = input().split()
    print(task_str)
    task_list = []
    task_list = [int(s, 10) for s in task_str]
    task_list.sort()
    print(task_list)
    result = int(task_list[2]) - int(task_list[0])
    print(result)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
num =input().split()
num.sort()
result = int(num[2]) - int(num[0])
print(result)

Submission status: Wrong Answer

Solution code:
num =input().split()
num.sort()
num.reverse()
result = int(num[0]) - int(num[2])
print(result)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
print(abs(b-a)+abs(c-b))

Submission status: Wrong Answer

Solution code:
tasks = sorted(map(int, input().split()))
cost = sum([tasks[i+1] - tasks[i] for i in range(1, len(tasks) - 1)])
print(cost)

Submission status: Wrong Answer

Solution code:
a1, a2, a3 = map(int, input().split())
x = abs(a2 - a1) + abs(a3 - a2)
y = abs(a3 - a1) + abs(a2 - a3)
if x < y:
    print(x)
else:
    print(y)

Submission status: Wrong Answer

Solution code:
a1, a2, a3 = map(int, input().split())
x = abs(a1 - a2) + abs(a2 - a3)
y = abs(a1 - a3) + abs(a3 - a2)
if x < y:
    print(x)
else:
    print(y)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
print(max(a))
print(min(a))
ans = (int(max(a))) - (int(min(a)))
print(ans)

Submission status: Wrong Answer

Solution code:
a = input().split()
ans = int(max(a))-int(min(a))
print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
a.sort
print(a[2]-a[0])

Submission status: Wrong Answer

Solution code:
def main():
    cost_list = input().split()
    for i in range(len(cost_list)):
        cost_list[i] = int(cost_list[i])
    cost_list.sort()
    print(cost_list)
    counter = 0
    for i in range(len(cost_list) - 1):
        counter += cost_list[i+1] - cost_list[i]
    print(counter)

main()

Submission status: Wrong Answer

Solution code:
def main():
    cost_list = input().split()
    for i in range(len(cost_list)):
        cost_list[i] = int(cost_list[i])
    cost_list.sort()
    cost_list.reverse()
    counter = 0
    for i in range(len(cost_list) - 1):
        counter += cost_list[i+1] - cost_list[i]
    print(counter)

main()

Submission status: Wrong Answer

Solution code:
a = [int(x) for x in input().split()]

a.sort(reverse=True)

print(a[2] - a[0])

Submission status: Wrong Answer

Solution code:
a = input()
b = a.split()
b.sort()
print(int(b[2])-int(b[0]))

Submission status: Wrong Answer

Solution code:
a = input()
b = a.split(' ')
b.sort()
print(int(b[2])-int(b[0]))

Submission status: Wrong Answer

Solution code:
# coding:utf-8

a = list(map(int, input().split()))
a.sort()
print(a)

num = 0
for i in range(len(a)-1):
    num += a[i+1] - a[i]

print(num)

Submission status: Wrong Answer

Solution code:
l = [int(i) for i in input().split()]
l.sort
a = abs(l[1] - l[0]) + abs(l[2] - l[1])
b = abs(l[2] - l[0]) + abs(l[1] - l[2])
if(a < b):
	print(a)
else:
	print(b)

Submission status: Wrong Answer

Solution code:
l = [int(i) for i in input().split()]
a = abs(l[1] - l[0]) + abs(l[2] - l[1])
b = abs(l[2] - l[0]) + abs(l[1] - l[2])
if(a < b):
	print(a)
else:
	print(b)

Submission status: Wrong Answer

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


if(abs(b-a) > abs(c-a)):
    print(abs(c-a)+abs(b-c))
else:
    print(abs(b-a)+abs(b-c))

Submission status: Wrong Answer

Solution code:
import math
li = list(map(int,input().split(" ")))
first =li[0]
el = li[1:]
el.sort()
s = 0
for i in el:
    s += abs(i - first)
    first = i
print(s)

Submission status: Wrong Answer

Solution code:
li = list(map(int,input().split(" ")))
first =li[0]
el = li[1:]
el.sort()
s = 0
for i in el:
    s += i - first
    first = i
print(s)

Submission status: Wrong Answer

Solution code:
li = list(map(int,input().split(" ")))
first =li[0]
el = li[1:]
el.sort()
s = 0
for i in el:
    s += i - first
    first = i

Submission status: Wrong Answer

Solution code:
A,B,C=(int(i) for i in input().split())
print(min((abs(B-A)+abs(C-B)),(abs(C-A)+abs(B-C))))

Submission status: Wrong Answer

Solution code:
import itertools

A1,A2,A3 = map(int,input().split())
    
vec = [A1,A2,A3]
com = list(itertools.permutations(vec))
    
all_cos = [0,0,0,0,0,0]
for i in range(6):
    tmp_com = com[i]
        
    tmp_A1 = tmp_com[0]
    tmp_A2 = tmp_com[1]
    tmp_A3 = tmp_com[2]
        
    cos1 = 0
    cos2 = abs(tmp_A1 - tmp_A2)
    cos3 = abs(tmp_A2 - tmp_A3)
        
all_cos[i] = cos1 + cos2 + cos3
    
res = min(all_cos)
print(res)

Submission status: Wrong Answer

Solution code:
a1, a2, a3 = map(int, input().split())
 
ans1 = abs(a1 - a2) + abs(a2 - a3)
ans2 = abs(a1 - a3) + abs(a3 - a2)
 
print(min(ans1, ans2))

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split())) 
a.reverse()
for i in range(len(a)):
  if i == 0:
    res = 0
  else :
    res += a[i-1]-a[i]
print(res)

Submission status: Wrong Answer

Solution code:
import itertools

def solve(A1,A2,A3):
    
    vec = [A1,A2,A3]
    com = list(itertools.permutations(vec))
    
    
    all_cos = [0,0,0,0,0,0]
    for i in range(6):
        tmp_com = com[i]
        
        tmp_A1 = tmp_com[0]
        tmp_A2 = tmp_com[1]
        tmp_A3 = tmp_com[2]
        
        cos1 = 0
        cos2 = abs(tmp_A1 - tmp_A2)
        cos3 = abs(tmp_A2 - tmp_A3)
        
        all_cos[i] = cos1 + cos2 + cos3
    
    res = min(all_cos)
    print(res)
    
    return res

Submission status: Wrong Answer

Solution code:
a=[int(i) for i in input().split()]

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

print(b)

print(sum(b)-max(b))

Submission status: Wrong Answer

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

if a == max(a,b,c):
    if b > c:
        print(str(a-c))
    else:
        print(str(a-b))
elif a == min(a,b,c):
    if b>c:
        print(str(b-a))
    else:
        print(str(c-a))
else:
    if b>c:
        print(str(b-a + b-c))
    else:
        print(str(c-a+c-b))

Submission status: Wrong Answer

Solution code:
import itertools


def solve(A1,A2,A3):
    
    vec = [A1,A2,A3]
    com = list(itertools.permutations(vec))
    
    
    all_cos = [0,0,0,0,0,0]
    for i in range(6):
        tmp_com = com[i]
        
        tmp_A1 = tmp_com[0]
        tmp_A2 = tmp_com[1]
        tmp_A3 = tmp_com[2]
        
        cos1 = 0
        cos2 = abs(tmp_A1 - tmp_A2)
        cos3 = abs(tmp_A2 - tmp_A3)
        
        all_cos[i] = cos1 + cos2 + cos3
    
    res = min(all_cos)
    
    return res

Submission status: Wrong Answer

Solution code:
temp = sorted(map(int, input().split()))
a=temp[0]
b=temp[1]
c=temp[2]

if a==b==c:
    print(0)
elif a==b!=c: 
    print(abs(a-c))
elif a!=b==c :
    print(abs(c-a))
elif a==c!=b:
    print(abs(a-b))
elif abs(a-b)<=abs(b-c):
    print(abs(b-c))
else:
    print(abs(a-b))

Submission status: Wrong Answer

Solution code:
def plo_A(A1,A2,A3):
    
    vec = [A1,A2,A3]
    com = list(itertools.permutations(vec))
    
    
    all_cos = [0,0,0,0,0,0]
    for i in range(6):
        tmp_com = com[i]
        
        tmp_A1 = tmp_com[0]
        tmp_A2 = tmp_com[1]
        tmp_A3 = tmp_com[2]
        
        cos1 = 0
        cos2 = abs(tmp_A1 - tmp_A2)
        cos3 = abs(tmp_A2 - tmp_A3)
        
        all_cos[i] = cos1 + cos2 + cos3
    
    res = min(all_cos)
    
    return res

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Spyderエディタ

これは一時的なスクリプトファイルです
"""

import numpy as np
import itertools


def plo_A(A1,A2,A3):
    
    vec = [A1,A2,A3]
    com = list(itertools.permutations(vec))
    
    
    all_cos = [0,0,0,0,0,0]
    for i in range(6):
        tmp_com = com[i]
        
        tmp_A1 = tmp_com[0]
        tmp_A2 = tmp_com[1]
        tmp_A3 = tmp_com[2]
        
        cos1 = 0;
        cos2 = abs(tmp_A1 - tmp_A2)
        cos3 = abs(tmp_A2 - tmp_A3)
        
        all_cos[i] = cos1 + cos2 + cos3
    
    res = min(all_cos)
    
    return res

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Spyderエディタ

これは一時的なスクリプトファイルです
"""

import numpy as np
import itertools


def plo_A(A1,A2,A3):
    
    vec = [A1,A2,A3]
    com = list(itertools.permutations(vec))
    
    
    all_cos = [0,0,0,0,0,0]
    for i in range(6):
        tmp_com = com[i]
        
        tmp_A1 = tmp_com[0]
        tmp_A2 = tmp_com[1]
        tmp_A3 = tmp_com[2]
        
        cos1 = 0;
        cos2 = abs(tmp_A1 - tmp_A2)
        cos3 = abs(tmp_A2 - tmp_A3)
        
        all_cos[i] = cos1 + cos2 + cos3
    
    res = min(all_cos)
    
    return res,all_cos,com

Submission status: Wrong Answer

Solution code:
list_task = list(map(int,  input().split()))
N = len(list_task)
# ソートによってリストを降順
list_task.reverse()
# 最初のコストは0なので最大値を削除し、それを次の計算のために変数に格納
total_cost = 0
last_number = list_task[0]
list_task.pop(0)
for i in list_task:
    total_cost +=  last_number - i
    last_number  = i 
print(total_cost)

Submission status: Wrong Answer

Solution code:
temp = sorted(map(int, input().split()))
a=temp[0]
b=temp[1]
c=temp[2]

if a==b==c:
    print(0)
elif a==b!=c: 
    print(abs(a-b))
elif a!=b==c :
    print(abs(c-a))
elif a==c!=b:
    print(abs(a-b))
elif abs(a-b)<=abs(b-c):
    print(abs(b-c))
else:
    print(abs(a-b))

Submission status: Wrong Answer

Solution code:
import math
a, b, c = (int(i) for i in input().split()) 
l = []
l.extend([abs(a-b),abs(b-c),abs(c-a)])
l.sort()
ans = l[0] + l[1]

Submission status: Wrong Answer

Solution code:
import math
a, b, c = (int(i) for i in input().split()) 
l = []
l.extend([abs(a-b),abs(b-c),abs(c-a)])
l.sort()
ans = l[0] + l[1]

Submission status: Wrong Answer

Solution code:
A1,A2,A3 = map(int,input().split())
B = abs(A1-A2)

if abs(A2-A3)>B:
    B = abs(A2-A3)
    if abs(A3-A1)>B:
        B = abs(A3-A1)

print(abs(A1-A2)+abs(A2-A3)+abs(A3-A1)-B)

Submission status: Wrong Answer

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

a = abs(list[1]-list[0])
b = abs(list[1]-list[2])
c = abs(list[2]-list[0])
if (a < b):
	print(a+b if b<c else c)
else :
	print(b+c if c<a else a)

Submission status: Wrong Answer

Solution code:
s = "11 5 5"
list = list(map(int, input().split()))

a = abs(list[1]-list[0])
b = abs(list[1]-list[2])
c = abs(list[2]-list[0])
if (a < b):
	sum = a + b if b < c else c
else :
	sum = b + c if c < a else a
print(sum)

Submission status: Wrong Answer

Solution code:
s = "11 5 5"
list = list(map(int, s.split()))

a = abs(list[1]-list[0])
b = abs(list[1]-list[2])
c = abs(list[2]-list[0])
if (a < b):
	sum = a + b if b < c else c
else :
	sum = b + c if c < a else a
print(sum)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

print(list)

list.sort()
sum = 0;
sum = list[2]-list[1]+list[1]-list[0]

print(sum)

Submission status: Wrong Answer

Solution code:
L = list(map(int,input().split()))
ans = 0
cnt = L.pop(0)
sorted_L = sorted(L)
for i in sorted_L:
    ans += abs(i - cnt )
    cnt = i
print(ans)

Submission status: Wrong Answer

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

a = abs(list[1]-list[0])
b = abs(list[1]-list[2])
c = abs(list[2]-list[0])
if (a < b):
	print(a+b if b<c else c)
else :
	print(b+ c if (c < a) else a)

Submission status: Wrong Answer

Solution code:
# your code goes here
import numpy as np
l = input().split()
lnp = np.zeros(len(l))
for i in range(len(l)):
	lnp[i] = int(l[i])
lnp = np.sort(lnp)
print(lnp[-1]-lnp[0])

Submission status: Wrong Answer

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

sum = 0
a = abs(list[1]-list[0])
b = abs(list[1]-list[2])
c = abs(list[2]-list[0])
if (a < b):
	if(a < c):
		if(b<c):
			print(a+b)
		else :
			print(a+c)
	else :
		print(c+a)
else :
	print(b+ c if (c < a) else a)

Submission status: Wrong Answer

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

sum = 0
a = abs(list[1]-list[0])
b = abs(list[1]-list[2])
c = abs(list[2]-list[0])
if (a < b):
	if(a < c):
		if(b<c):
			print(a+b)
		else :
			print(a+c)
	else :
		print(c+a)
else :
	print(a+ c if (c < a) else a)

Submission status: Wrong Answer

Solution code:
task =  [int (i) for i in "100 100 100".split(" ")]
ans=5000
if abs(task[0]-task[1])+abs(task[2]-task[0]) < ans:
	ans = abs(task[0]-task[1])+abs(task[2]-task[0])
if abs(task[0]-task[2])+abs(task[1]-task[0]) < ans:
	ans = abs(task[0]-task[2])+abs(task[1]-task[0])
if abs(task[1]-task[0])+abs(task[2]-task[1]) < ans:
	ans = abs(task[1]-task[0])+abs(task[2]-task[1])
if abs(task[1]-task[2])+abs(task[0]-task[1]) < ans:
	ans = abs(task[1]-task[2])+abs(task[0]-task[1])
if abs(task[2]-task[0])+abs(task[1]-task[2]) < ans:
	ans = abs(task[2]-task[0])+abs(task[1]-task[2])
if abs(task[2]-task[1])+abs(task[0]-task[2]) < ans:
	ans = abs(task[2]-task[1])+abs(task[0]-task[2])
print(ans)

Submission status: Wrong Answer

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

if b>c: b,c = c,b
if a>b: a,b = b,a

ans = c-a

print(ans)

Submission status: Wrong Answer

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

print(min(abs(b-a)+abs(b-c),abs(c-a)+abs(c-b)))

Submission status: Wrong Answer

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

print(abs(a-b)+abs(b-c))

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
print(abs(c-b)+abs(c-a))