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:
A = [int(t) for t in input().split()]

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

Submission status: Accepted

Solution code:
from sys import stdin
a = [int(x) for x in sorted(stdin.readline().rstrip().split())]
print(abs(a[0] - a[1]) + abs(a[1] - a[2]))

Submission status: Accepted

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

Submission status: Accepted

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

print(max(x) - min(x))

Submission status: Accepted

Solution code:
inp = list(sorted([int(x) for x in input().split()]))
print(inp[2]-inp[0])

Submission status: Accepted

Solution code:
x = sorted([int(i) for i in input().split()])
score = 0
for i in range(len(x)):
    if i == 0:
        a = x.pop()
    else:
        b = x.pop()
        score += a - b
        a = b
print(score)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

A = [int(x) for x in stdin.readline().rstrip().split()]

A.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(x) for x in input().split()]
b = []
b.append(abs(a[0] - a[1]))
b.append(abs(a[1] - a[2]))
b.append(abs(a[0] - a[2]))
b.pop(b.index(max(b)))
print(sum(b))

Submission status: Accepted

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

print(max(x)-min(x))

Submission status: Accepted

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

a = abs(y-x) + abs(z-y)
b = abs(z-x) + abs(y-z)
c = abs(x-y) + abs(z-x)
d = abs(z-y) + abs(x-z)
e = abs(x-z) + abs(y-x)
f = abs(y-z) + abs(x-y)

print(min(a,b,c,d,e,f))

Submission status: Accepted

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

Submission status: Accepted

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


def solve(A: "List[int]"):
    ret = max(A) - min(A)
    print(ret)
    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:
a, b, c = sorted(map(int, input().split()))

print(c - 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:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    a1, a2, a3 = intin()

    a12 = abs(a1 - a2)
    a23 = abs(a2 - a3)
    a31 = abs(a3 - a1)

    mina = min(a12 + a23, a23 + a31)
    mina = min(mina, a31 + a12)
    print(mina)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
lst = list(map(int,input().split()))
lst.sort(reverse=True)
print((lst[0] - lst[1]) + (lst[1] - lst[2]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import permutations
def cost(aa):
    return abs(aa[1]-aa[0]) + abs(aa[2]-aa[1])
aa=map(int,input().split())
print(min(map(cost,permutations(aa))))

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


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()]
B=[0]*3
B[0]=abs(A[1]-A[0])+abs(A[2]-A[0])
B[1]=abs(A[2]-A[1])+abs(A[0]-A[1])
B[2]=abs(A[0]-A[2])+abs(A[1]-A[2])
print(min(B))

Submission status: Accepted

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

A.sort(reverse=True)

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

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, b, c = abs(A[0]-A[1]), abs(A[1]-A[2]), abs(A[2]-A[0])
print(min(a+b, b+c, c+a))

Submission status: Accepted

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

for i in range (len(li) - 1, 0, -1):
  li[i] -= li[i - 1]

li[0] = 0
ans = 0

for i in li:
  ans += i

print(ans)

Submission status: Accepted

Solution code:

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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
a = list(map(int, sys.stdin.readline().split()))
diff = sorted([abs(a[i] - a[i+1]) for i in range(-1,len(a)-1)])
print(diff[0] + diff[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int,input().split())
d = abs(a-b)
e = abs(b-c)
f = abs(a-c)
list = [d,e,f]
list1 = sorted(list)
print(list1[0]+list1[1])

Submission status: Accepted

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

a_b = abs(a - b)
b_c = abs(b - c)
a_c = abs(a - c)

print(( a_b + b_c + a_c) - max(a_b,b_c,a_c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
ans = 200
for i in range(3):
  for j in range(3):
    if j == i:
      continue
    for k in range(3):
      if k == i or k == j:
        continue
      ans = min(ans, abs(A[k] - A[j]) + abs(A[j] - A[i]))
print(ans)

Submission status: Accepted

Solution code:
a_1, a_2, a_3 = map(int, input().split())

maxs = max(a_1, a_2, a_3)
mins = min(a_1, a_2, a_3)
ans = maxs-mins
print(ans)

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

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

print(M-m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(int(i) for i in input().split())  
a = sorted(a)

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

Submission status: Accepted

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

tLst = []
for i in range(3):
    for j in range(i, 2):
        tLst.append(int(abs(ALst[i] - ALst[j + 1])))

tLst.sort()
ans = tLst[0] + tLst[1]
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


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


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]"
    result = solve(A)
    print(result)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = sorted(map(int,input().split()))
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()

ans = 0
for i in range(3):
    if i==0:
        continue
    ans += abs(A[i]-A[i-1])

print(ans)

Submission status: Accepted

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

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

a.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
n = abs(a-b)
m = abs(b-c)
l = abs(c-a)
x = max([n,m,l])
print(n+m+l-x)

Submission status: Accepted

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

alist = [a1, a2, a3]
#print(alist)
min1 = min(alist)
index = alist.index(min1)
alist.pop(index)

#print(alist)
min2 = min(alist)
print(min1 + min2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
alist=input().split()
alist_int=[int(i) for i in alist]
alist_int.sort()
min=int(alist_int[0])
max=int(alist_int[2])
ans=max-min
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans =0
for i in range(len(c)-1):
    ans += c[i+1] - c[i]
print(ans)














# ??!~<<??11z<<<<<+(J+gQWHMMMHHHHUUUVVz<<<<1OOOOXWWkqHHHHHHHkqkqHHkqHHHHHHHkHHHUHHHHHHHHWWWWWWWWWWWWWWUUUVVOOOOOOOOOOOOOOOOOwZXVwVZZZOOOOOOz<<<<<<<<<<<<
#  ......-_(JgXVB9UUZyyyyWWyVVyWXzvrI<::++z+1zOXfWkkkkkkkkkkkkkkkkkbkbbbbbppHo(dppppfffffVVVVyyyyyyyZZuvrrttttttv1llllllllztrZ!_?rttttttll?;;;;;;::~~~~~
# yUUUUUUWVVk&++?zOwXuuuvvXyVyZuuzZv~~~``~!  (OXkkqkkkkkkkkkkkkkkkkkkkbbbbbbbWbppppf?77T4pVfVVVVyyyyZuvrrttttttt>(ttttlltrrvZ:_-Jrrrtttllz>;;;;;;::~~~~~
# .........-?74WyXx<zOOwrrzuuuuzzZz<_(+<     __zTWkqqqkkqkkqkkkkkkkkkkkkbbbbbbbbpppR....JffffVVVVyyZuzvrrrrrrrrrrrtttttrvvzzw+Owvrrrrrtlz>>>>>>>;:~:~~_(
# VVVVVVyVVVWA..(TWWs<11lOvuuzzwI??1zztO+-(_``.(&dXWWqqqkqqkkqkkkkkkkkbkkkbbbpppbpppppppppfpffffVyyuuuzzzzvvrrrrrrrrrrwwuuzzuuzzzvvrrtlz?>?????<::~~:(<+
# yyVyVyVyVVVyyV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WHWWXY>:~~~~........`.......``.`````````.`..-?CXZkz+.?WyVVVVVVVyyyyyyWsdZXrtrvzzzzvttlllzwzzzuzzzzzv
# yVVVyVyyC .yyWY``.dVVV}.VVVfpppppbpbWHyyyyWWHVVVVWHKY<::::::~~~~...-----(((((J(-(......`.`..`.._..?4XAz<.?WfffVVVVVyyyyyZZXrrrzzuuzzrrtttOwuuuuuuuzzzz
# OVyVyVVf (VWY``.dVyyVW!.fWfpfppppbWHWyyyyWHHVVVVVH3_::::::::((J&QWHHHWHUkyZZZyyyXXWkXXUUX&J-........_Tkz+i.CWpffVVyVVyyyZuvvzuuuuuzzvrrrvzuuuuuuuuuzzv
#  OVyVVf`-WY``.uWVyVVV$ dyffpfppWpWHyyyyVWHHVVfVfWC::::::(+dHHHffVffffWNkWyWZZZZZZwXXkwrwvZWkZUG--~~.~_14yz<.,WpWffVVVVyZ0zzuuuZuuuzzzvvzuuZuuuuuuuuuzz
# +.UyyS!.Y!`.JyVVyVyy0~.VyWffppfpHWyyyyyWHMVVfffpHI::++gHHfWHpfffVfWfVXHkXkWXZXXOOuZOXkOlzrrXWzvwZUa,~._1vk1?- 7WWffVVyWXuuuZZZZZuuuuzuuuZZZZZZZZuuuuuu
# _!.WX!,!`.JVyWyVyVy0!.XVVVVffpWHXyyyyVWgMVffffWWUijdMHppppWpVVVWZWWXXZHHkXWwXZOz=OI?wuO<;1rtZWzZOwrZW&-_1?kl(-`(WpfVyyuuZZZyZZZZZXZuXXXXyyZZZZZZuuuuuu
# .``(:``.JyyyVyVyVWf~.XyyyVVVfWHyZyyyyWHHVVffWWpHdHHppffppVHfSyySuXWXkXdgHkWkwXz+?zXzjuXc;;OZzZRrvzrrrZUn-<zwo(-  TWWyZZZyyyyyZZZZZZ2<dZyyZyZZZZZZuuZZu
# Wn.` .JVyyVyVyVWV^.JVWVVyVVfWHyyyyyVWMMHfffpWpWMHpfppyppXXHV0XZWvvWkWuwHHHwWXZOzi+wI+XZI<>jw<zXkI:zrOOOOXk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HWkZZZXkUkzzrwOzz1<<<-.`_<+:___
# <>??1zOrrvzwZ7?TuXWXqmHVWMffffVfWHM@WbppbbbWXWH@MkkWMMNMMMMNMMNp__==``   ``.?<.__<79WWHHOMNfMNNMN/(WMNJHWHWfWdVWHyyyyZXHq$<wZZWZOXtzztltOOO&+_~~.-_<_`
# ;<1=zttrOIz____..7WHmgHVfMpWfpfpWMMMHbpbWHbbppMHMkHMMMMNWMMNMMMN.` `        `   ``.JHY77HMMMMMMMM@ _7HHJNWHWSXVWHWVyyXXXHqWkyZXSrOwOtzvzlll1+?1&-<<__-
# ++1=ltrrrvwzz<__._(UmgHVVMfWXpppbMM@NpppbHWbppWHNHHMH1M#MMqMMHHM{     `    `  `  ?"!   .NBW9TGdHMN. _dHv?HWHdfffWHWWVyWXWHqqkyXdkrrZwtlO++1z1=?<<+i+1(
# ztltttrrrrrvvOx<___~ZgHVVMpfXfpppM@@MWbbbWNbkbbM@BM@!.##"4C?HKjM{ ` `  ` ` `  ``  `  ``.{`.Ngv9TH#`  .g]__WdMWfffHWHVVVVkUWHqkXvWkwrrXOl==1+<?<<<<<77?
# JltttttttrrOdHXHgQWHgHHVV@WpXpfppH@@@HbbbbHHbkHHPJ#_  W` dBB6jWY `   `    `     -       ?Hm+-JadgF ` JH' _d@NMkpfHkWkfVVfWy4WqHywWWwvwZXz==z1:` `  ..(
# llllllltOOwWXHmmmmmmHMfff@HpZppppWM@@NHbkkW@HkkbHJW+` .WkmJvY"=!`` `  ` `  `` __< ` `  ```` _?TC=``.7!` .(HW@HHkfWHWHkfffVfWsVWHkXkOXwrOtZwv!.-_-_~(dz
# lllltlzlOdWWqHHmmmHMgHfffMHpZpfpppM@@MHbWbkH@HkkbH/_7  .7_...````````  `     ` _( `  ` ``````.``````   .`jHWHM@MkfWWHgkfpfWHkWAvWWWOtlOXwwv<(:(<((jwZX
# zllzlOGdWWkH@HmHHgmHgHffWMHpyfpfppHMM>HHkkHHH@HkkWH,`...........``````  `` `    `  `  `````` ....... .``.HpWH@H@MHWHHHHHfppfWHHkkzUktltlzI+&z+<?CdSXXX
# lzugkHbHHWHHH9AHHHVWg@ffWMHpZpppppWHD:?HpbbHkHMNbbHH,._....._.._.```` `  ` `  `   ` ` ` ``` _`-.........WpWH@H@@HMNHHWH@HWfpfffWHHkJSZzlll==zTXy+-?XWH
# HkWHHWkHBUOltdHVVVWggMfpM@HpXpfppfpMb~vWbbbkHbHH@HkbH&_.....~....````` `  `  `  `   `  ``````..`_..-_..XWHH@@@H@@H@NqpWH@MHpfpWWXWHHkXyOll==z=uXWkkXZW
# WWU90llllltzdVVyVVHgM#fWMHHfXppppWWHN_>XkbbpWNpHHMVbkkh-.......`.```` ` `  `  `  ` ` ` `````````.`....WWDdM@H@@g@H@NMkpM@@HMkpffWXZWgHXkttltuWqHqHHHWX
# _?TwzzlttldWXyVyVWHNMffWMHHWXffppWXWMp~dHbbppWHbHHb~7WkHe-` `````````  ` ` ` ` ` `    `   ````````` (X=J<H@@@@Mg@M@MMMWW@@@@@MkWfWXvUHHkWwgmmHgHHWUIzz
# ::::<zyOdWXyyVyVWgHHNfWHMHHRWppppWXWMMxJWHppppWHpHH_`._74Wm..``````  ` `  ` ``  ` ``     `  ` `` `.7!`.%(M@@@@HHHWMMH@NW@HmH@MHHkpkXzvWHHHHHBBUWS&O==l
# ::::;:(7kyyyVVVWgHMMHWMM@gpSppfVVSdpMHMgWMWpppfWNbWR.` _ `  _?``` ` ` ` ` `  .... ` `` `  `  `  `  `  Z(@Hg@g@qq#X@@@@MH@mmg@MMgHHkkz1zWHHHWWXuuuXww0y
# :;;:;;:;<4WyVVWkHMM#XWMMggWdWyfXX0dpHHMMWHNpppWWHMHH.?i-`` ``    `  `  ` `.Z1;;<1Zl   ` `  `  `   ` `(ggggqmgHkWSHHHgg@gHqqqHHSXuvwHWyOwWHgKWkXZuuuuuw
# XA&+<;;;;<vWyWHMMkY1WMMMHHSX0XWzwIdpHMHMHHHNpppWXWMHb ` ?<.`` ` `  ` `   (>;;;;;;;d:  `  `  `  `` ` .HgHmHHqqpbKdWmqmmgHHHHWVVyXkmHSdWWyXyHNz=zVWkZXkV
# XwZXWHex>+>?HgMMH[ .dMMMgHXSzXWXwIdpWM@MHWHMNppfWZWMH[  ` (- ` ` `  ` ` `u+;;;;:;+2 `  ` ` ` `  _` .HqqqHpkHHfKwSXkkqqHHWffWWWHHqqHOlzWfVyVHZ====1f'``
# Zy0XXWWVWez=zHHHM#AdMHHgHHdXZWWkwIdfH@MMNW@NWHfVyXOWMH;  ` ..  `  `  ` `  ?<+<<<?``  `  ` ` ` ``` .HHqkHfWWYT77!???7"TWWkWHbHMmkkq6lllzWWVyWb=z=z^``
# UOwyWXXXVWMmyzW@MVVW@@MggSfZWWWkXIXfMMMMNpHNpWHfkwOwXWHx.   _`  ` ` ` ` `` `` .`   `  `   `  `  .dkWHWHV= .!`      ` _._(zTYY9YUW0yuzzlzWyyWH?12``  `
# XyWWSwVyWWgmNWHWHVWM@@MHHXfyVWHWXlXfMMHpHfWMpHMNWkwOwZWNe-.`` ` `  ` `  `  `` _`` `` ` ` `  ``.dHWWpWV! .!`      ` .-~~        `  `` _Tx=WyWWz^``  `.(
# WHSwXVfWgggH@@HHXWHM@HMHXHVVVWHykzVWHpppHWfH@@@HMHfkXZAXWmV&-. ` ``  ` `  `      `  ` ` ``` .dmHHkpK!  .`    `   ``          `          ?wHWY``  ` (::
# WXXVVWHgggH@MgHHWWHbWkHSHHVVyWHy0dVWHbbpWkWWHMM@@@NkffWWwWWHeVu.. ` `  ` `  ` ` ` ` ` `` .JgHHmqqY:   .`                  `   .._________~(^   ` .(;;<
# XWyWHgmgH@MggHMHyHNkbpHXmHyVyHHVkdVWWHkMHNVWM@@@MH@MNWppWkXHHHWxvO+. ``  ` ` ` ` ` ```.(HMHHMNH@<`    _`                ` ..JdWHHHHHHmgJ_J`  ` _<1<<+1
# yWWHHHHMHggg@@MyWH@@M#dmgHVyyHNySXyWM@MMMMXVM@HH@@@@@MNkpfpffpVWHmx+7z-.``` ` `` ` .J=<J@@@@MHD_   ` .           `  ` ` .dWZyWyWQkWkWW@H#`` `  _:<O=uS
# WggmNJMgggH@@HMyX@@@MdMMmHWyyWNyyyyH@@@@HMKVHH@M@@@@@$cdNkppppWhJWWW+;:<71-. `  .JC<:::(MMMHH@_    ` _`  `  `     `   (XZZyyWkY>~_`__:+?%``  `  _:<zSz
# ggggggggg@@HM@@VXMHMX@@NWmHyyWHWyyyWgg@@HHNWWMM@@@@@@g@HH@MkfpppHs+TkW+<:::(??7C(::::::<zdkHM~       :  `      `    (dXyyyWWY~ `  .(<! ._ ` ` `  _:<Oy
# mggggmgg@MM@@@HHWM#X@@@@HHqkyWHHyZyWHHHkHHMHWMg@@Hgg@g@@@@@MMkpHkWh<?UWe<::::::::::::::(dkkH%     ` ._   .    ` ` _(HfpfWW9~    .(!`  ` 1``  `    _::O
# ggmmgmHM@@@HH#WkXBd@@gHHHXqHkXqNyyyXHWHMgggMWWHHqggHg@ggg@HMMMNkWHWW<:?Wn:::::::~::~::(dbkHF       `._  .~    ` .(XHkbbW#>` ``./!   `  ` l ` `     ~::
# gmmgmH@@@HHY3jHMSHHqqkHHHHXHHkWHHyZXSdHHggg@NyHWgggHMggggHM@MM8VWWHHW_:?W<::~::~::::~_dpkbK``  `   ` ;` ~~     _JdHWkHH@:` ` .``  `` `  ` ?+. ....._::
# mmmHH@@@M9>_+MHWHWHHHHHkkHqXHqXqHkyWWggggHHHHNXMHHMgmgggMH@M9Izd?WWMHh:~Jr:::::::~~``JWpWW\          < .~~ `  (+1WHqHHD<``      `    `` ` `j?&``.`.-<<
# mqH@@HHY<<;jMHXkHHHHmHYY1>>vkWHWkHkyWHggg@gHkWMkMHgHggBMMMMz<<<J<?HWMH[~J<:::~::~`` (HHppP  `     ` `(__::_ `.+1j@@@H#:~`` `` `  ` `  ` `` .I(h.` ..(<
# WHMHW6<<<>jMkqkHgHH9z>>>>??<?WUHkHNkZWHHMgHkkmgHHHVY3<(@@MD<;<<>::?HWMN(>:::::~`  ,jHWppW>    `      .<_:~_` <<+d@@@M$:_  `  ` `` ` `  `  ``.%.o ` .-j
# HMW6;;;><jWHkkHHH9<>1z<???????ZwWqkHkXMMmHbbHBY>_?4n_~W@@MI;:::::::JKWN<::::~`` (~.WVVVWP`    `  `   `<:~:~_(::<d@@@M<::_-.  `      ``  ` `.>`._I.` _d
# NV<;;;;;;dmkH$dH$<<>>>+>>??????+HyWkHkXHmHY>~~~~~:~_?4M@@N<<::::::::HfM<::~` ` /  dVVWVK`    `   _    ._::::_:~(d@H@Hz:::::_.` `  ` ` `` `.2 .~(+v+..H
# $(::;;;;jHHH3;WH;>>>>>>><<~~~~<(HHNkWHHkH_~~~~~~~~~~__HHHHo+<((((_(:dX#~` ` ` (` (WVVWX!  `       __~..<~~::~::(jH@@HR<:::::__ `  `  `  `./ ._(+zwwyWK
# (::::;;:dHH$<;?W+>;::::~~:__- .HHHqHHkUWHk&__.....````dHpbh_   ` ```-H] `  ` _ .JffVWX!             _~__1:~~:~:~(W@MHNz+<:::::__.```` `  c`._<1zwXX9=<
# ::::::<<dHX;;;;;1+;;;;;:_((:~(HHkHHpkH6YOwVWa,..``````,NpbWh:__...   H!  ``-_`.XfffWf`  `     `   ` ` _<(<(~:~~::?M@@MN=1i:::::::___.  ./ .(+zOwXHJ(((
# ::::::::WHP:;;;;;;;;;;;>>>><jHWHWXWWk$(_~._<77T1.```   wWppph<~____ .`` ```..WWWfVX^  `            `   ___<+_<_~:~?H@@@Nzz1+::::::::~_(2 _(+zOwZyWk<?7
# :~::::::dHk::;;:;;;;;;;;>>;jWWUV1KWbH~_<....`````       4WppWHx.` ` !``..(WHpfpWK= `       `           `.~_<<1++~:~<THH@Mmzzz<:::::::<2__(+zwwZyyVWHe+
# ~:~~:::::4Xc::::;:;;:;;;;+dWXX6>dWWHR~~(-..````        ` ?WppWpWHkAAQWHHHpfppWY^              `        `..~~~~(?T&~~~<TMMMMNgd&<<<;<<v ~(+zwXZyyVyVfHH

Submission status: Accepted

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

temp1 = abs(A1 - A2) + abs(A2 - A3)
temp2 = abs(A2 - A3) + abs(A3 - A1)
temp3 = abs(A3 - A1) + abs(A1 - A2)

print(min(temp1, temp2, temp3))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
A = list(map(int, input().split()))
m = float('inf')
for v in list(itertools.permutations(A)):
  tmp = abs(v[1] - v[0]) + abs(v[2] - v[1])
  if tmp < m:
    m = tmp
print(m)

Submission status: Accepted

Solution code:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


a = inl()
print(max(a)-min(a))

Submission status: Accepted

Solution code:
A = list(map(int,input().split()))
s = sum(A)
ans = 1000
for i in range(3):
    for j in range(3):
        if i == j:
            continue
        b = abs(A[i]-A[j])+abs(A[j]-(s-(A[i]+A[j])))
        ans = min(ans,b)
print(ans)

Submission status: Accepted

Solution code:
A = list(map(int,input().split()))
cnt = 0
cost = 0
sum_A = sum(A)
min = 9999
for i in range(len(A)):
    cost = 0
    for j in range(len(A)):
            if i != j:
                cost = abs(A[j] - A[i] ) + abs(A[j] - (sum_A - A[i] - A[j]))
                if min > cost:
                    min = cost
cost = 0
print(min)

Submission status: Accepted

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

print(max(a1,a2,a3)-min(a1,a2,a3))

Submission status: Accepted

Solution code:
# ABC103A - Task Scheduling Problem
data = sorted(list(map(int, input().rstrip().split())))
print(data[2] - data[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import permutations
A1, A2, A3 = (int(i) for i in input().split())

res=1000
for (a, b, c) in permutations([A1,A2,A3], 3):
    intermediate = abs(a-b)+abs(b-c)
    if(intermediate< res):
        res=intermediate

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
ret123 = abs(a[1]-a[0]) + abs(a[2] - a[1])
ret132 = abs(a[2]-a[0]) + abs(a[1] - a[2])
ret213 = abs(a[0]-a[1]) + abs(a[2] - a[0])
ret231 = abs(a[2]-a[1]) + abs(a[0] - a[2])
ret312 = abs(a[0]-a[2]) + abs(a[1] - a[0])
ret321 = abs(a[1]-a[2]) + abs(a[0] - a[1])
print(min([ret123, ret132, ret213, ret231, ret321, ret312]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
x =abs(a-b)
y =abs(b-c)
z =abs(c-a)
print(min(x+y,y+z,z+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:
a1,a2,a3 = map(int, input().split())
print(max(a1,a2,a3)-min(a1,a2,a3))

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:
def main():
	A = list(map(int, input().split()))
	A.sort()
	print(A[2]-A[0])


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

a.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

A.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

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()
res = 0
for i in range(1, len(A)):
    res += A[i] - A[i-1]
print(res)

Submission status: Accepted

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

A.sort()
ans = 0
for i in range(1, len(A)):
    ans += abs(A[i] - A[i-1])

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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