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

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

Submission status: Accepted

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

list = sorted([abs(a-b), abs(b-c), abs(c-a)],reverse=True)

print(list[1]+list[2])

Submission status: Accepted

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

Submission status: Accepted

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

A.sort()

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

Submission status: Accepted

Solution code:
list = [int(i) for i in input().split()]
print(max(list) - min(list))

Submission status: Accepted

Solution code:
A = sorted(list(map(int, input().split())), reverse=True)
print(abs((A[1]-A[0])) + abs((A[2]-A[1])))

Submission status: Accepted

Solution code:
n = [int(_) for _ in input().split()]
n.sort()
print(n[2]-n[0])

Submission status: Accepted

Solution code:
#!/usr/bin/python

def main():
    A = [int(x) for x in input().split()]
    print(max(A)-min(A))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
*A, = sorted(map(int, input().split()))
print(A[2]-A[0])

Submission status: Accepted

Solution code:
A = [int(i) for i in input().split()]
A.sort()
print(A[2] - A[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

X = [abs(A - B), abs(B - C), abs(C - A)]

print(sum(X) - max(X))

Submission status: Accepted

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

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

N.sort()


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

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
D = abs(A - B)
E = abs(A - C)
F = abs(B - C)
if D >= E and D >= F:
    print(D)
elif E >= D and E >= F:
    print(E)
else:
    print(F)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import itertools
import collections
import functools
import math
from queue import Queue
INF = float("inf")


def solve(A: "List[int]"):
    A.sort()
    print(A[2]-A[0])
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = [int(next(tokens)) for _ in range(3)]  # type: "List[int]"
    solve(A)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
*l, = map(int, input().split())
print(max(l)-min(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a1, a2, a3 = map(int, input().split())
a = sorted([a1,a2,a3])
print(a[2] - a[0])

Submission status: Accepted

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

t=0
if a > b :
    t=a
    a=b
    b=t
if b > c :
    t=b
    b=c
    c=t
if a > b :
    t=a
    a=b
    b=t

print(c-a)

Submission status: Accepted

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

task = [a1, a2, a3]
task = sorted(task)

ans = abs(task[0] - task[1]) + abs(task[1] - task[2])
print(ans)

Submission status: Accepted

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

x.sort()

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

Submission status: Accepted

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

c1 = abs(a1-a2)
c2 = abs(a2-a3)
c3 = abs(a1-a3)

C = [c1,c2,c3]
D = sorted(C)
ans = D[1]+D[0]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
a = sorted(a)[::-1]
ans = 0
for i in range(1,3):
    ans += abs(a[i]-a[i-1])
print(ans)

Submission status: Accepted

Solution code:
N=sorted(map(int,input().split()));c=0
for n in range(1,len(N)):
    c+=N[n]-N[n-1]
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A_1, A_2, A_3 = map(int, input().split())
alist = [A_1, A_2, A_3]
print(max(alist) - min(alist))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def cal(a,b,c):
    return abs(b-a)+abs(c-b)

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


print( min( cal(a,b,c),cal(a,c,b),cal(b,a,c),cal(b,c,a),cal(c,a,b),cal(c,b,a) ) )

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a1,a2,a3=map(int,input().split())
l=[a1-a2,a1-a3,a2-a3]
l=list(map(abs,l))
l.sort()
print(l[0]+l[1])

Submission status: Accepted

Solution code:
a1,a2,a3 = map(int,input().split())
li = [a1,a2,a3]
li.remove(min(li))
li2 = [a1,a2,a3]
print(sum(li)-min(li2)-min(li))

Submission status: Accepted

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

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

a.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = [int(i) for i in input().split()]
n.sort()
print(int(n[2]-n[0]))

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
ans += abs(list_a[0]-list_a[1])
ans += abs(list_a[1]-list_a[2])

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
li = [int(x) for x in input().split()]
cost = 10**9
for i in range(3):
  for j in range(3):
    for k in range(3):
      if(i==j or j==k or i==k):continue
      cost = min(cost,abs(li[i]-li[j])+abs(li[j]-li[k]))
print(cost)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L = list(map(int,input().split()))
cost = 0
max_L = max(L)
L.remove(max_L)
second_L = max(L)
cost = max_L - second_L
L.remove(max(L))
cost += second_L - L[0]
print(cost)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=[int(i) for i in input().split()]
A.sort()
print((A[2]-A[1])+(A[1]-A[0]))

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
a = sorted(a)
diff_list = [a[i+1] - a[i] for i in range(len(a)-1)]
ans = sum(diff_list)
print(ans)

Submission status: Accepted

Solution code:
l = sorted([int(i) for i in input().split()])
print(l[2]-l[0])

Submission status: Accepted

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(c-a))
print(ans)

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
a.sort()
b = 0

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

print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
s=sorted(a)[::-1]
r=0
c=0
for e in s:
  if r!=0: c+=abs(r-e)
  r=e
print(c)

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
ans=[10**8]*6
ans[0]=abs(a[1]-a[0])+abs(a[2]-a[1])
ans[1]=abs(a[2]-a[0])+abs(a[1]-a[2])
ans[2]=abs(a[0]-a[1])+abs(a[2]-a[0])
ans[3]=abs(a[2]-a[1])+abs(a[0]-a[2])
ans[4]=abs(a[0]-a[2])+abs(a[1]-a[0])
ans[5]=abs(a[1]-a[2])+abs(a[0]-a[1])
print(min(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = [int(i) for i in input().split()]
print(max(A)-min(A))

Submission status: Accepted

Solution code:
nums = list(map(int, input().split(' ')))
nums.sort()
buf = nums[0]
nums = list(map(lambda x: x - buf, nums))
print(nums[2])

Submission status: Accepted

Solution code:
import numpy as np
from sys import stdin
data=[int(x) for x in stdin.readline().rstrip().split()]
data=np.array(data)
data=sorted(data)
print(np.sum(np.diff(data)))

Submission status: Accepted

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

A.sort(reverse=True)
for i in range(3):
    if i == 0:
        sum=0
    else:
        sum = sum+abs(A[i] - A[i-1])
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
a = [A,B,C]
a.sort()
#(a[1]-a[0])+(a[2]-a[1])
print(a[2]-a[0])

Submission status: Accepted

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

A.sort()
print(abs(A[1] - A[0]) + abs(A[2] - A[1]))

Submission status: Accepted

Solution code:
def solve(string):
    a = sorted(map(int, string.split()))
    return str(sum([abs(a1 - a0) for a0, a1 in zip(a, a[1:])]))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

Solution code:
from itertools import permutations


def solve(string):
    a = map(int, string.split())
    ans = min(sum([abs(_p0 - _p1) for _p0, _p1 in zip(p, p[1:])]) for p in permutations(a, 3))
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

Solution code:
A, B, C = sorted(map(int,input().split()))
print(C-B+B-A)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
a=sorted(a)
c=0
for i in range(len(a)):
    if i==0:
        x=a[i]
    else:
        c+=abs(a[i]-x)
        x=a[i]
print(c)

Submission status: Accepted

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

total1=abs(a-b)+abs(b-c)
total2=abs(a-c)+abs(b-c)
total3=abs(a-b)+abs(a-c)

temp=0

if total1>total2:
	temp=total1
	total1=total2
	total2=temp

if total1>total3:
	temp=total1
	total1=total3
	total3=temp

print(total1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
A = [int(x) for x in stdin.readline().rstrip().split()]

print(max(A)-min(A))

Submission status: Accepted

Solution code:
def task_scheduling_problem(A1: int, A2: int, A3: int)->int:
    return max(A1, A2, A3) - min(A1, A2, A3)


if __name__ == "__main__":
    A1, A2, A3 = map(int, input().split())
    ans = task_scheduling_problem(A1, A2, A3)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A1, A2, A3 = map(int, input().split())
ans = min([abs(A1 - A2) + abs(A2 - A3), abs(A1 - A3) + abs(A2 - A3), abs(A1 - A2) + abs(A1 - A3)])
print(ans)

Submission status: Accepted

Solution code:
A1,A2,A3=map(int,input().split())
print(min([abs(A1-A2)+abs(A2-A3),
          abs(A2-A3)+abs(A3-A1),
          abs(A3-A1)+abs(A1-A2)]))

Submission status: Accepted

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

print(max(l) - min(l))

Submission status: Accepted

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

A = sorted(A)
ans = A[2] - A[0]
print(ans)

Submission status: Accepted

Solution code:
A1, A2, A3 = map(int, input().split())
costs = [abs(A1-A2), abs(A2-A3), abs(A3-A1)]
sorted_costs = sorted(costs)
print(sum(sorted_costs[:-1:]))

Submission status: Accepted

Solution code:
# /user/bin/python
# -*- coding: utf-8 -*-
import sys 


a1,a2,a3 = map(int, sys.stdin.readline().rstrip().split())

def solve(i,j,k):
  ret = abs(i-j) + abs(j-k)
  return ret

s1 = solve(a1,a2,a3)
s2 = solve(a3,a1,a2)
s3 = solve(a2,a3,a1)
print(min(s1,s2,s3))

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
l_list=[A,B,C]
l_list.sort()
print(int(l_list[2])-(l_list[0]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=sorted(list(map(int,input().split())))
print(0+A[2]-A[0])

Submission status: Accepted

Solution code:
An = sorted(list(map(int,input().split())))
ans = 0
coslist = []
for i,a in enumerate(An):
    if i ==0:
        coslist.append(abs(a-i))
    else:
        ans+=abs(a-(An[i-1]))
        coslist.append(abs(a-(An[i-1])))
print(ans)

Submission status: Accepted

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

answer = max(A1,A2,A3) - min(A1,A2,A3)

print(answer)

Submission status: Accepted

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 = list2[1] - min(list2)
print(b + c)

Submission status: Accepted

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

print(max(a)-min(a))

Submission status: Accepted

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

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

print(min((cost1, cost2, cost3)))

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
a.sort()
cost = 0
for i in range(len(a)-1):
    cost += a[i+1] - a[i]
print(cost)

Submission status: Accepted

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

l=[]
l.append(abs(a[0]-a[1])+abs(a[1]-a[2]))
l.append(abs(a[1]-a[2])+abs(a[2]-a[0]))
l.append(abs(a[2]-a[0])+abs(a[0]-a[1]))
print(min(l))

Submission status: Accepted

Solution code:
*cost_list,=map(int,input().split())
print(max(cost_list)-min(cost_list))

Submission status: Accepted

Solution code:
*cost_list,=map(int,input().split())
cost_list.sort(reverse=True)
sum=0
for i in range(len(cost_list)-1):
  sum+=(cost_list[i]-cost_list[i+1])
print(sum)

Submission status: Accepted

Solution code:
A = [int(i) for i in input().split()]
A.sort()
print(A[1]-A[0] + A[2]-A[1])

Submission status: Accepted

Solution code:
cost_list=list(map(int,input().split()))
cost_list.sort(reverse=True)
sum=0
for i in range(len(cost_list)-1):
  sum+=(cost_list[i]-cost_list[i+1])
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc103/tasks/abc103_a
a1, a2, a3 = [int(x) for x in input().split()]
tl = sorted([a1, a2, a3])
print(tl[-1] - tl[0])

Submission status: Accepted

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

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

l = sorted(l, reverse=True)
print(sum(a-b for a, b in zip(l, l[1:])))

Submission status: Accepted

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

ans = max(As) - min(As)

print(ans)
print()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L = list(map(int, input().split()))
Ldiff = []
Ldiff.append(abs(L[1] - L[0]))
Ldiff.append(abs(L[2] - L[1]))
Ldiff.append(abs(L[0] - L[2]))
Ldiff.sort()
print(Ldiff[0] + Ldiff[1])

Submission status: Accepted

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

Submission status: Accepted

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

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

print(Cost[0] + Cost[1])

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
L = [A, B, C]
L.sort()
ans = 0
for i in range(2):
    ans += abs(L[i+1] - L[i])
print(ans)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
l=[a,b,c]
x,y,z=sorted(l)
print(z-x)

Submission status: Accepted

Solution code:
from sys import stdin
a,b,c=sorted([int(x) for x in stdin.readline().rstrip().split()], reverse=True)
print(a-c)

Submission status: Accepted

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

cost = 0
cache = 0
for task in tasks:
    if cache != 0:    
        cost += abs(cache - task)
    cache = task
print(cost)

Submission status: Accepted

Solution code:
def main():
    a1, a2, a3 = map(int, input().split())
    cost = sorted([abs(a1 - a2), abs(a1 - a3), abs(a2 - a3)])
    print(cost[0] + cost[1])


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lst = list(map(int, input().split()))
lst = sorted(lst)
ans = 0
for i in range(1, len(lst)):
    ans += abs(lst[i]-lst[i-1])
print(ans)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc103/tasks/abc103_a


def main():
    A1, A2, A3 = map(int, input().split())
    print(max(A1, A2, A3) - min(A1, A2, A3))

if __name__ == '__main__':
    main()

Submission status: Accepted

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(len(A)-1):
    ans += A[i+1] - A[i]
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
import numpy as np

def input_numbers():
    temp = list(map(int, input().split()))
    return temp

def GCD(a, b):
    if(a < b):
        temp = a
        a = b
        b = temp
    a = a % b
    if(a == 0):
        return b
    else:
        return GCD(a, b)

a = input_numbers()

m = 10000000000000000000

for i in range(3):
    for j in range(3):
        for k in range(3):
            if(i != j and j != k and k != i):
                cost = abs(a[i] - a[j]) + abs(a[j] - a[k])
                m = min(m, cost)

print(m)

Submission status: Accepted

Solution code:
def main() -> None:
    l = list(map(int, input().split()))
    ls = sorted(l, reverse=True)
    ans = 0
    for i in range(len(ls) - 1):
        ans = ans + abs(ls[i] - ls[i+1])

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(abs(a[0]-a[1])+abs(a[1]-a[2]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = [int(i) for i in input().split()]
A.sort()
print(A[1]-A[0] + A[2] - A[1])

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i in range(1, 3):
    ans += a[i-1] - a[i]
print(ans)

Submission status: Accepted

Solution code:
m,_,M=sorted(map(int,input().split()))
print(M-m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = [int(x) for x in input().split()]
A.sort()
print(A[2] - A[0])

Submission status: Accepted

Solution code:
A=[int(i) for i in input().split()]
A.sort()
print(A[2]-A[0])

Submission status: Accepted

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

ans = sorted([abs(a-b),abs(b-c),abs(c-a)])

print(sum(ans[:2]))

Submission status: Accepted

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

array = [abs(a1-a2), abs(a2-a3), abs(a3-a1)]
array.sort()
print(array[0] + array[1])

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
s=[A,B,C]
s.sort()
print(s[2]-s[0])

Submission status: Accepted

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

cost = A[1] -A[0]
cost +=  A[2] - A[1]

print(cost)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = sorted(map(int,input().split()))
print(abs(C - B) + abs(B - A))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(int,input().split()))
d = [abs(s[0]-s[1]),abs(s[1]-s[2]),abs(s[2]-s[0])]
print(sorted(d)[0]+sorted(d)[1])

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
a.sort()
ans = 0
for i in range(1,3):
    ans += abs(a[i] - a[i-1])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = sorted(map(int,input().split()))
print(abs(B-C)+abs(A-B))

Submission status: Accepted

Solution code:
a = input().split()
for i in range(3):
    a[i] = int(a[i])
a = sorted(a)
print((a[2]-a[1]) +(a[1]-a[0]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    l = list(map(int, lines.pop(0).split(' ')))
    l.sort()
    print(l[2] - l[0])

#
# main
#

# 1. use list instead of stdin
# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A1, A2, A3 = map(int, input().split())
    print(max(A1, A2, A3) - min(A1, A2, A3))


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = sorted([int(n) for n in input().split()])
print(a[2] - a[0])

Submission status: Accepted

Solution code:
""" AtCoder """

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

a.sort()

ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

A = list(map(int, input().split()))
A.sort()
print(A[2] - A[0])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    A = list(map(int, input().split()))

    D1 = abs(A[1] - A[0])
    D2 = abs(A[2] - A[1])
    D3 = abs(A[0] - A[2])

    print(D1 + D2 + D3 - max(D1, D2, D3))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

tasks = list(map(int, input().split()))
tasks.sort()
print((tasks[2] - tasks[1]) + (tasks[1] - tasks[0]))

Submission status: Accepted

Solution code:
X=input().split()
Y=(min(X))
X.remove(Y)
Z=int(min(X))
print(abs(Z-int(Y))+abs(int(max(X))-Z))

Submission status: Accepted

Solution code:
A = sorted([int(i) for i in input().split()])
cost = 0
for i in range(len(A) - 1):
    cost += A[i + 1] - A[i]

print(cost)

Submission status: Accepted

Solution code:
s=list(map(int,input().split()))
s.sort()
ans1=abs(s[0]-s[1])
ans2=abs(s[1]-s[2])
print(ans1+ans2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
A.sort()
ans = 0
for i in range(len(A)-1):
    ans += abs(A[i+1] - A[i])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = sorted([i for i in map(int, str(input()).split())])
print(A[2] - A[0])

Submission status: Accepted

Solution code:
arr = sorted(list(map(int,input().split())))
print(arr[-1]-arr[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tasks = list(map(int,input().strip().split(' ')))
tasks = sorted(tasks)
print(tasks[2]-tasks[0])

Submission status: Accepted

Solution code:
def main(tasks):
    tasks = list(map(int, tasks))
    tasks.sort(key=lambda x: -x)
    print(abs(tasks[0] - tasks[1]) + abs(tasks[1] - tasks[2]))

if __name__ == '__main__':
    main(input().strip().split(' '))

Submission status: Accepted

Solution code:
ar = sorted(map(int, input().strip().split()))

diff = []
for i in range(0,2):
    diff.append(abs(ar[i + 1] - ar[i]))

diff = sorted(diff)


#for i in range(0,1):
 #   su += abs(diff[i + 1] - diff[i])

print(sum(diff))

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i in range(1, len(a)):
	ans += abs(a[i] - a[i-1])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(lst):
    print(max(lst)-min(lst))

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

Submission status: Accepted

Solution code:
a=[int(x) for x in input().split()]
s=0
temp=max(a)
for y in sorted(a,reverse=True):
    s+=abs(temp-y)
    temp=y
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A1,A2,A3 = input().split()

A1 = int(A1)
A2 = int(A2)
A3 = int(A3)

A = sorted(list((A1,A2,A3)))

cost = 0

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

Submission status: Accepted

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

Submission status: Accepted

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