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:
import numpy as np


a, b, c = map(int, input().split())
d = np.abs(a-b)
e = np.abs(b-c)
f = np.abs(c-a)
ans = [d+e, e+f, f+d]
print(min(ans))

Submission status: Accepted

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

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

    ans = min([c1, c2, c3])
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = [int(num) for num in input().split()]
a1 = a[0]
a2 = a[1]
a3 = a[2]
ans = min(abs(a1-a2)+abs(a3-a2),abs(a3-a1)+abs(a3-a2))
ans = min(ans,abs(a1-a2)+abs(a3-a1))
ans = min(ans,abs(a2-a3)+abs(a3-a1))
ans = min(ans,abs(a3-a1)+abs(a1-a2))
ans = min(ans,abs(a3-a2)+abs(a2-a1))
print(ans)

Submission status: Accepted

Solution code:


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

lis = sorted([int(i) for i in input().split()])
print((lis[1] - lis[0]) + (lis[2] - lis[1]))

Submission status: Accepted

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

cost = 0
for i in range(1, len(tasks)):
    cost += abs(tasks[i] - tasks[i - 1])

print(cost)

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:
alst = list(map(int, input().split()))
ans = 1000
for i in range(3):
  for j in range(3):
    for k in range(3):
      if i != j and j != k and i != k:
        ans = min(ans, 0 + abs(alst[j] - alst[i]) + abs(alst[k] - alst[j]))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x=max(a,b,c)
n=min(a,b,c)

print(abs(x-n))

Submission status: Accepted

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

for i in range(len(a)):
    for j in range(len(a)):
        if a[i]<a[j]:
            a[i], a[j]=a[j], a[i]

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

print(s)

Submission status: Accepted

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

result = 0

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

print(result)

Submission status: Accepted

Solution code:
a1,a2,a3 = map(int, input().split())
a_list = [a1,a2,a3]
a_list_sort = sorted(a_list)
ans_1 = a_list_sort[1]-a_list_sort[0]
ans_2 = a_list_sort[2]-a_list_sort[1]
print(ans_1+ans_2)

Submission status: Accepted

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

D = []
D.append(abs(A-B)+ abs(B-C))
D.append(abs(A-C)+ abs(B-C))
D.append(abs(A-B)+ abs(A-C))

print(min(D))

Submission status: Accepted

Solution code:
#coding:utf-8
a=[int(i) for i in input().split()]
count=0
a.sort()
for i in range(2):
  count+=abs(a[i+1]-a[i])
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
perm = [[0,1,2], [0,2,1], [1,0,2], [1,2,0], [2,0,1], [2,1,0]]
res = float('inf')
a = list(map(int,input().split()))
for p in perm:
  tmp = 0
  for i in range(2):
  	tmp += abs(a[p[i]]-a[p[i+1]])
  res = min(res, tmp)
print(res)

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 = list(map(int,input().split()))
n1 = abs(a - b)
n2 = abs(b - c)
n3 = abs(a - c)
n4 = max(n1, n2, n3)
print(n1 + n2 + n3 - n4)

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, B, C= map(int,input().split())
a=abs(A-B)
b=abs(B-C)
c=abs(C-A)
print((a+b+c)-max(a,b,c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A1, A2, A3 = [int(elem) for elem in input().split(' ')]

abs1 = abs(A1 - A2)
abs2 = abs(A1 - A3)
abs3 = abs(A2 - A3)

sum_task = sum([abs1, abs2, abs3]) - max([abs1, abs2, abs3])
print(sum_task)

Submission status: Accepted

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

Submission status: Accepted

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

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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

A.sort(reverse=True)
B = A.copy()
B.sort()

ans_a = 0
ans_b = 0
for i in range(1,3):
    ans_a +=abs(A[i]-A[i-1])
    ans_b += abs(B[i]-B[i-1])
    
print(min(ans_a,ans_b))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


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


def read_str():
    return input()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A):
    ans = 0
    A_ = [(a, i) for i, a in enumerate(A)]
    A_.sort()

    A.sort()
    p = A[0]
    for a in A:
        ans += abs(a-p)
        p = a
    return ans


def main():
    A = read_int_n()
    print(slv(A))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A1,A2,A3 = map(int, input().split())
    a12 = abs(A1-A2)
    a23 = abs(A2-A3)
    a31 = abs(A3-A1)
    cost = [a12+a23, a23+a31, a31+a12]
    return min(cost)

if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:

def main():
    a = [int(i) for i in input().split()]

    a.sort()
    ans = abs(a[0] - a[1]) + abs(a[1] - a[2])

    print(ans)
            
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

maxa = max(aas)
mina = min(aas)

print(maxa-mina)

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

Solution code:
import numpy as np

a = list(map(int,input().split()))
a = np.sort(a)
cos = 0
for k in range(2):
    cos += np.abs(a[k] - a[k+1])
print(cos)

Submission status: Accepted

Solution code:
# coding=utf-8

if __name__ == '__main__':
    cost_list = list(map(int, input().split()))
    cost_list.sort()
    print(cost_list[2]-cost_list[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

A = reads()

print(min(abs(p[1] - p[0]) + abs(p[1] - p[2]) for p in permutations(A)))

Submission status: Accepted

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

ar_int.sort()
print(0 + abs(ar_int[1] - ar_int[0]) + abs(ar_int[2] - ar_int[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,b,c=map(int,input().split())
d=max(a,b,c)
e=min(a,b,c)
print(d-e)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b,c = map(int, input().split(" "))
ab = abs(a-b)
ac = abs(a-c)
bc = abs(b-c)
print(ab+ac+bc-max(ab,ac,bc))

Submission status: Accepted

Solution code:
#coding:utf-8
A = list(map(int, input().split()))
A.sort()
cost = 0
prev = A[0]
for a in A:
    cost += abs(a - prev)
    prev = a

print(cost)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = map(int, input().split())
    a = sorted(a)
    ans = (a[1] - a[0]) + (a[2] - a[1])
    print(ans)

Submission status: Accepted

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

    cost = 0

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

    print(cost)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(max(line)-min(line))

Submission status: Accepted

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

A = max(a,b,c)
C = min(a,b,c)
B = int((a*b*c)/(A*C))

print(A-B+B-C)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
from itertools import permutations

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

ans = float('inf')
for a, b, c in permutations(A, 3):
    x = abs(b - a) + abs(c -a)
    ans = min(ans, x)
print(ans)

Submission status: Accepted

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

a = abs(B-A) + abs(C-B)
b = abs(C-A) + abs(B-C)
c = abs(A-B) + abs(C-A)
d = abs(C-B) + abs(A-C)
e = abs(A-C) + abs(B-A)
f = abs(C-B) + abs(A-C)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def inpl(): return map(int, input().split())
A = sorted(list(inpl()))
print(sum([A[i+1] - A[i] for i in range(len(A)-1)]))

Submission status: Accepted

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

A1 = A[-1]
A2 = A[1]
A3 = A[0]

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

Submission status: Accepted

Solution code:
# cook your dish here
a = list(map(int,input().split()))
a.sort()

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

Submission status: Accepted

Solution code:
x = map(int,raw_input().split())
print max(x) - min(x)

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

Submission status: Accepted

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

s=[abs(a-b),abs(a-c),abs(b-c)]
s.sort()
print(s[0]+s[1])

Submission status: Accepted

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

Submission status: Accepted

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

d = [abs(A[0] - A[1]), abs(A[1] - A[2]), abs(A[2] - A[0])]

d.sort()

r = sum(d[:-1]) 
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

B = [abs(A[0]-A[1]),abs(A[1]-A[2]),abs(A[2]-A[0])]

x = min([B[0]+B[1],B[1]+B[2],B[2]+B[0]])

print(x)

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())

a,b,c = getNM()
list = [a,b,c]

list.sort()
print(list[2]-list[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b1 = abs(a[0]-a[1])+abs(a[1]-a[2])
b2 = abs(a[0]-a[2])+abs(a[2]-a[1])
b3 = abs(a[1]-a[0])+abs(a[0]-a[2])
b4 = abs(a[1]-a[2])+abs(a[0]-a[2])
b5 = abs(a[2]-a[0])+abs(a[0]-a[1])
b6 = abs(a[2]-a[1])+abs(a[0]-a[1])
ans = min(b1, b2, b3, b4, b5, b6)
print(ans)

Submission status: Accepted

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

b=abs(A[0]-A[1])+abs(A[0]-A[2])

c=abs(A[0]-A[1])+abs(A[1]-A[2])
d=abs(A[0]-A[2])+abs(A[1]-A[2])

print(min(b,c,d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = map(int, raw_input().split())
print max(x) - min(x)

Submission status: Accepted

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

ans = A[2] - A[0]  

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

a.sort()

value = (a[1]-a[0]) + (a[2]-a[1])

print(value)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import *
a, b, c = map(int, input().split())
q1 = abs(a-b)
q2 = abs(b-c)
q3 = abs(c-a)

print(min(q1+q2,q2+q3,q3+q1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import permutations
A = list(map(int, input().split()))

ans = float('inf')
for x, y, z in permutations([0, 1, 2]):
    ans = min(ans, abs(A[x]-A[y]) + abs(A[y]-A[z]))
print(ans)

Submission status: Accepted

Solution code:
from numpy import *
from scipy import *
from sys import *

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    xs = sorted([int(s) for s in input().split()])
    print(sum(a - b for (a, b) in zip(xs[1:], xs[:len(xs) - 1])))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
one,two,three = map(int,input().split())
ma = max([one,two,three])
mi = min([one,two,three])
print(ma-mi)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split(" "))
a = abs(A-C)
b = abs(B-C)
c = abs(A-B)

print(a+b+c - max([a,b,c]))

Submission status: Accepted

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

ans = 0
for i in range(2):
    ans += A[i+1] - A[i]

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, b, c = map(int, input().split())
print(min(min(abs(a-b)+abs(b-c), abs(b-c)+abs(a-c)), abs(a-b)+abs(a-c)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
T = [int(i) for i in input().split()]
a, b, c = sorted(T)
ans = abs(b - a) + abs(c - b)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

a = list(map(int, input().split()))
a = sorted(a)
ans = 0

for i in range(len(a)):
    if i == 0:
        pass

    else:
        ans += (a[i] - a[i-1])

print(ans)

Submission status: Accepted

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

n.sort()

#print(n)
sum = 0
for i in range(len(n)-1):
    sum += abs(n[i]-n[i+1])

print(sum)

Submission status: Accepted

Solution code:
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
a=i2()
a.sort()
a=a[::-1]
print(a[0]-a[2])

Submission status: Accepted

Solution code:
# your code goes here
A = list(map(int,input().split()))

A.sort()

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

Submission status: Accepted

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

print(max(li)-min(li))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!


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

ans=S[2]-S[0]

print(ans)

Submission status: Accepted

Solution code:
l = sorted([int(c) for c in input().split()])

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

Submission status: Accepted

Solution code:
X = list(map(int,input().split()))
X.sort()
print(X[1]-X[0] + X[2]-X[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 = [int(i) for i in input().split()]

ans = 0

A.sort()

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

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=list(map(int, input().split(" ")))
print(max(a)-min(a))

Submission status: Accepted

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

tmp = array[0]
ans = 0
for i in array[1:]:
    ans += i-tmp
    tmp = i
print(ans)

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=list(map(int,input().split()))
b=max(a)
c=min(a)
print(b-c)

Submission status: Accepted

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

d=abs(a-b)
e=abs(a-c)
f=abs(b-c)
print(d+e+f-max(d,e,f))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import permutations

A = map(int, raw_input().split())
ans = float('inf')
for p in permutations([0, 1, 2]):
    tmp = abs(A[p[0]] - A[p[1]]) + abs(A[p[1]] - A[p[2]])
    ans = min(ans, tmp)
print ans

Submission status: Accepted

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

Submission status: Accepted

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

max=max([a,b,c])
min=min([a,b,c])

print(max-min)

Submission status: Accepted

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

print(max(a,b,c)-min(a,b,c))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
    l = l * a[i] // fractions.gcd(l, a[i])
# print(l)

m = l-1

# f
fm = 0
for i in range(N):
    fm += m % a[i]
print(fm)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
list=input()
list_n=[int(s) for s in list]
print(int(max(list_n))-int(min(list_n)))

Submission status: Runtime Error

Solution code:
list=input()
list_n=[int(s) for s in list]
print(max(list_n)-min(list_n))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = [int(i) for i in input().split()]
x = sorted(x)
cost = 0
for i in range(1, 3):
    cost += abs(x[i] - x[i-1])
print(costs)

Submission status: Runtime Error

Solution code:
    ar=[int(i) for i in input().strip().split(" ")]
    ar.sort()
    s=0
    for i in range(1,len(ar)):
        s+=(ar[i]-ar[i-1])
    print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

min_num = min(a12,a13, a23)

print(sum(a12,a13,a23) - min_num)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(n[3]-n[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

L = [a,b,c]
L.sorted()

print(abs(L[2]-L[0]))

Submission status: Runtime Error

Solution code:
A_1 = int(input())
A_2 = int(input())
A_3 = int(input())

list = [A_1, A_2, A_3]
new_list = sorted(list)
print(new_list[2] - new_list[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
print("Yay!" if A<=8 and B<=8 else ":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B,C=map(int,input().split())
list1=[A,B,C]
sorted(list1,reverse=False)
answer=0
answer=list[0]-list[1]
answer=list[1]-list[2]+answer
print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# ABC103A

import numpy as np

 = list(map(int, input().split()))
def task(b):
    return abs(b[1] - b[0]) + abs(b[2] - b[1])
a = np.array(a)
p = np.array([[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]) - 1
Min = np.inf
for i in range(6):
    Min = min(Min, task(a[p[i,:]]))
print(Min)

Submission status: Runtime Error

Solution code:
import numpy as np

b = list(map(int, input().split()))
def task(b):
    return abs(b[1] - b[0]) + abs(b[2] - b[1])
a = np.array(a)
p = np.array([[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]) - 1
Min = np.inf
for i in range(6):
    Min = min(Min, task(a[p[i,:]]))
print(Min)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().spliT())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
L=[d,e,f]
L.sort()
print(L[0]+L[1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

a = abs(a-b),b = abs(b-c),c = abs(c-a)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
Not found

Submission status: Runtime Error

Solution code:

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

print(ans(a[3]-a[1]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# lines = list(map(int, "1 6 3".split()))
lines.sort()

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(lines[2]-lines[1] + lines[1]-lines[0]  )

Submission status: Runtime Error

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

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(cnt)

Submission status: Runtime Error

Solution code:
print("YNeos"[input() not in input()*3::2])

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

x = abs(A1 - A2)
y = abs(A2 - A3)
z = abs(A3 - A1)

if x + y <= y + z and x <= z + x:
	print(x + y )
elif y + z <= x + y and  y + Z <= z + x:
	print(y + z )
else:
	print(z + x)

Submission status: Runtime Error

Solution code:
a1,a2,a3=map(int,input().split())
k=sorted[a1,a2,a3]
print( abs(k[2]-k[1]) + abs(k[1]-k[2]))

Submission status: Runtime Error

Solution code:
a1,a2,a3=map(int,input().split())
k=[a1,a2,a3]
print( abs(max(k)-max(k)[1]) + abs(max(k)[1]-max(k)[2]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A=list(map(int, input().split()))
A.sort()
m=abs(A1-A2)
n=abs(A2-A3)
print(m+n)

Submission status: Runtime Error

Solution code:
def LI():
	return [ int(s) for s in input().split() ]

A = LI()

A12 = abs(A[0]-A[1])
A23 = abs(A[1]-A[2])
A31 = abs(A[3]-A[1])

print(min(A12+A23,A23+A31,A31+A12))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input().split()
A=sorted(S)
print(S[2]-S[0])

Submission status: Runtime Error

Solution code:
n , m = map(int, input().split())
# ab = [list(map(int, input().split())) for _ in range(m)]
ranges = [[] for _ in range(m)]
for i in range(m):
    a,b = map(int,input().split())
    ranges[i] = [a,b]
ranges = sorted(ranges, key = lambda x:x[1])
MAX = - float("inf")
ans = 0#１つめはノーカン
for i in range(m):
    if MAX < ranges[i][0]:
        MAX = ranges[i][0] - 0.1
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
#abc103 b
s=input()
t=input()
flag=False
for i in range(len(s)):
    new_t=t[-1]
    new_t+=t[:-1]
    if new_t==s:
        flag=True
        break
    t=new_t

print("Yes" if flag else "No" )

Submission status: Runtime Error

Solution code:
11 5 5