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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

def func(m,AS):
  ans = 0
  for a in AS:
    ans += (m % a)
  return ans
    
  
ans = 0
for i in range(2,10**5+1):
  a = func(i,AS)
  if a > ans:
    ans = a
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
T = input()

if S == T:
    print('Yes')
l = len(S)
L = list(S)
for i in range(l):
    a = L[0]
    del L[0]
    L.append(a)
    s = ''.join(L)
    if s == T:
        print('Yes')
        break
else:
    print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools
a=map(int,input().split())
ans=999
l=[0,1,2]
for x in itertools(l,3):
  tmp=abs(a[x[0]]-a[x[1]])+abs(a[x[1]]-a[x[2]])
  if tmp <=ans:
    ans =tmp
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
T = input()
X = 0
for i in range(len(S)):
  S = S[-1] + S[:-1] 
  print(S)
  if S == T:
    X = 1

if X == 0:
  print('No')
elif X == 1:
  print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = []
m = 1

def f(m, a):
    s_tmp = 0
    for i in range(n):
        s_tmp = s_tmp + m % a[i]
    return s_tmp

for i in range(n):
    m = m * a[i]

print(f(m-1, a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

r = abs(a-b) + abs(a-c) + abs(b-c)
r = r - max(abs(a-b) , abs(a-c) , abs(b-c))
print(int(r))

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

import pandas as pd

print(int(pd.Series(A).sort_values().diff().sum()))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

*a = map(int, sys.stdin.readline().split())

def main():
    return max(a) - min(a)

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

Submission status: Runtime Error

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

min = float('inf')

for i in range(3):
	for j in range(3):
		if i==j:
          break
        min = min(abs(A[i]-A[j]), min)

print(min)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
T = input()

ans = 'No'
for _ in range(len(S)):
    if S == T:
        ans = 'Yes'
        break
    S = S[-1] + S[:-1]

print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
a=map(int, input().split())
print(sum(a)-N)

Submission status: Runtime Error

Solution code:
s1 = input()
print("Yes" if input() in tuple(s1[i:] + s1[:i] for i in range(len(s1))) else "No")

Submission status: Runtime Error

Solution code:
li = [map(int, input().split())]
sli = sorted(li)

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

Submission status: Runtime Error

Solution code:
s = input()
t = input()

print("Yes" if t in s*2 else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

B = A.sort(reverse=True)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
main = do 
  xs <- map read . words <$> getLine :: IO [Int]
  putStrLn . show $ (maximum xs) - (minimum xs)

Submission status: Runtime Error

Solution code:
main = do 
  xs <- map read . words $ getLine :: IO [Int]
  putStrLn . show $ (maximum xs) - (minimum xs)

Submission status: Runtime Error

Solution code:
S = input()
T = input()

cur = T.find(S[0])
i = 0
con = len(S)

while con != 0:
  if S[i] == T[cur]:
    con -= 1
    
    if con == 0:
      print("Yes")
    
    i += 1
    if cur == (len(S) - 1):
      cur = 0
    else:
      cur += 1
  else:
    print("No")
    break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split(' '))
sections = [list(map(int,input().split(' '))) for _ in range(M) ]

'''
tmp_list = [sections[0]]
for i in range(1,len(sections)):
    for j in range(i):
        if sections[i] < tmp_list[j]:
            tmp_list.insert(j,sections[i])
            break
        if j == i -1:
            tmp_list.append(sections[i])
'''
min_end = 10000000000000000
sorted_list = sorted(sections)
cnt = 0
for section in sorted_list:
    if min_end <= section[0]:
        cnt += 1
        min_end = min_end = 10000000000000000
    min_end = min(min_end,section[1])
cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
# A - Task Scheduling Problem
*a=map(int,input().split())
print(max(a)- min(a)

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(M)]
AB.sort()

ans=0
while AB:
  a=AB[-1][0]
  AB=list(filter(lambda x:x[1]<=a,AB))
  ans+=1
  
print(ans)

Submission status: Runtime Error

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

banned_list = []
for i in range(M):
    banned_list.append(tuple(map(int,input().split())))
banned_list = sorted(banned_list,key=lambda x:x[1])
#status = [1 for _ in range(N-1)]
status = set()
counter = 0
for i in range(M):
    a = banned_list[i][0]
    b = banned_list[i][1]
    if len([one for one in status if (one >= a-1 and one < b-1)]) == 0:
        status  |= {b-2}
        counter += 1
print(counter)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

X = X.sort()
ans = X[1] + X[2]
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from fractions import gcd

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

lcm = a[0]
for i in a:
    lcm = lcm * i // gcd(lcm, i)
ans = 0
for i in a:
    ans += (lcm-1) % i
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
1,A2,A3=map(int,input().split())
A=[A1,A2,A3]
A.append(A1)
def A_(i):
    if A[i]-A[i+1]>=0:
        return A[i]-A[i+1]
    else:
        return A[i+1]-A[i]
B=[A_(i) for i in range(3)]
B.append(A_(0))
B.append(A_(1))
def sum(j):
    return B[j]+B[j+1]
C=[sum(j) for j in range(3)]
print(min(C))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
// B103.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int a[3];
	cin >> a[2] >> a[1] >> a[0];
	sort(a, a + 3);
	cout << abs(a[0] - a[1]) + abs(a[1] - a[2]) << endl;

	return 0;
}

Submission status: Runtime Error

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

Solution code:
r=sorted(map(int,input().split()))[-1]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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, m = map(int, input().split())
a, b = [0] * m, [0] * m
for i in range(m):
    a[i], b[i] = map(int, input().split())
bridge = []
for i in range(m):
    bridge.append(list(range(a[i], b[i])))
cnt = 0

while True:
    cnt_passed = [0] * (n - 1)
    for bri in bridge:
        for j in bri:
            cnt_passed[j - 1] += 1
    removed = cnt_passed.index(max(cnt_passed)) + 1
    for bri in bridge[:]:
        if removed in bri:
            bridge.remove(bri)
    cnt += 1
    if len(bridge) == 0:
        print(cnt)
        exit(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = [i for i in input()]
T = [j for j in input()] 

x = sorted(S)
y = sorted(T)
k = None

if x == y:
  for i in range(len(S)):
    O = S.copy()
    S.pop()
    S.insert(0,O[-1])
    if S == T:
      print("Yes")
      break
  else:
    print("NO")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=list(int(input().split()) for i in range(3))
print(max(a)-min(a))

Submission status: Runtime Error

Solution code:
a=[int(input().split()) for i in range(3)]
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:
N, M = list(map(int, input().split(' ')))
edges = []
for i in range(M):
    a, b = list(map(int, input().split(' ')))
    edges.append([v for v in range(a, b)])

ans = 0
while any(edges):
    hit_index = 0
    max_hit = 0
    edge = []
    for i in range(len(edges)):
        if edges[i]:
            edge = edges[i]
            break
    for v in edge[::-1]:
        hit = 0
        for i in range(M):
            if edges[i] and v in edges[i]:
                hit += 1
            if hit > max_hit:
                max_hit = hit
                hit_index = v
    # print('max_hit')
    # print(max_hit)
    # print('cut here')
    # print(hit_index)
    for i in range(len(edges)):
        if edges[i] and hit_index in edges[i]:
            edges[i] = False
    ans += 1
    # print('cutted')
    # print(edges)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
T=input()
 
if S==T:
    ans="Yes"
else:
    ans="No"
    for _ in range(len(S)):
        rotated_S=S[len(S)-1:]+S[:len(S)-1]
        if rotated_S==T:
            ans="Yes"
            break
        else:
            S=rotated_S
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
T = input()
cnt = 0
s = S + S
for i in range(len(S)+1):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
if cnt==len(T) or S == T:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = input()
T = input()
cnt = 0
s = S + S
for i in range(len(S)+1):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
if cnt==len(T) or S == T:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = sorted(map(int,input().splitu()))
v = s[2] - s[0]
print(v)

Submission status: Runtime Error

Solution code:
A = list(map(int,input().split()))
ans = []
a = abs(A(0)-A(1))+abs(A(1)-A(2))##0→1→2
b = abs(A(0)-A(2))+abs(A(2)-A(1))##0→2→1
c = abs(A(1)-A(0))+abs(A(0)-A(2))##1→0→2
ans.append(a)
ans.append(b)
ans.append(c)
print(min(ans))

Submission status: Runtime Error

Solution code:
l = list(map(int,input().split()))
l.sort()
ans = []
for i in range(N-1):
  ans.append(l[i+1] - l[i])
print(sum(ans))

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:
tasks = sorted([int(v) for v in input.split()])
print(tasks[-1]-tasks[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
t = input()
cnt = 1
for _ in range(len(s)):
    a = s[len(s)-1]
    b = [s[i] for i in range(len(s)-1)]
    bb = "".join(b)
    s = a+bb
    if s == t:
        cnt *= 0

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

Submission status: Runtime Error

Solution code:
s = input()
t = input()
for _ in range(len(s)):
    a = s[len(s)-1]
    b = [s[i] for i in range(len(s)-1)]
    bb = "".join(b)
    s = a+bb
    if s == t:
        print("Yes")
        exit()
print("No")

Submission status: Runtime Error

Solution code:
s = input()
t = input()
for _ in range(len(s)):
    s = s[len(s)-1]+"".join([s[i] for i in range(len(s)-1)])
    if s == t:
        print("Yes")
        exit()
        
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input(int()).split()
sort_a = sorted(a)
ans = sort_a[-1]-sort_a[0]

Submission status: Runtime Error

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

Submission status: Runtime Error

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


def solve(A: "List[int]"):
    print(abs(A[0] - A[1] + abs(A[1] - A[2]))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
T = input()

for i in range(len(S)-1):
    if S == T:
        print('Yes')
        exit()
    x = S[-1]
    S = list(S)
    S.pop(-1)
    S.insert(0,x)
    S = ''.join(S)


print('No')

Submission status: Runtime Error

Solution code:
S = input()
T = input()

for i in range(len(S)-1):
    x = S[-1]
    S = list(S)
    S.pop(-1)
    S.insert(0,x)
    S = ''.join(S)
    if S == T:
        print('Yes')
        exit()

print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = [int(i) for i in input().split()]
a.sort()
b = [a[2]-a[1], a[1]-a[0], a[2]-[0]]
print(sum(b)-max(b))

Submission status: Runtime Error

Solution code:
from sys import stdin
import fractions

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

lcm_a = int(A[0] * A[1] / fractions.gcd(A[0], A[1]))

if len(A) > 2:
    for k in A[2:]:
        lcm_a = int(lcm_a * k / fractions.gcd(lcm_a, k))

modulo_sum = 0

for k in A:
    modulo_sum += (lcm_a - 1) % k

print(modulo_sum)

Submission status: Runtime Error

Solution code:
from fractions import gcd
N = int(input())
A = list(map(int,input().split()))

def lcm(a,b): return a*b//gcd(a,b)

l = A[0]
for i in range(1,N):
    l = lcm(l,A[i])
l -= 1

ans = 0
for a in A: ans += l % a
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
t = input()
for _ in range(len(s)):
    if s == t:
        print('Yes')
        break
    s = s[-1] + s[:-1]
else:
    print('No')

Submission status: Runtime Error

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

ad = sorted(a, reverse=True)
ans = (ad[0]-ad[1] + (ad[1]-ad[2])
print(ans)

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())).sorted
print(A[2] - A[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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]-(a-(A[i]+A[j])))
        ans = min(ans,b)
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = sorted([int(input()) for _ in range(3)])

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# include <stdio.h>
#include <stdlib.h>

int cmp( const void *p, const void *q ) {
    return *(int*)p - *(int*)q;
}

int main(){
    int A[3];

    scanf("%d%d%d", &A[0], &A[1], &A[2]);

    qsort(A, 3, sizeof(int), cmp);

    int cost = 0;
    for (int i = 1; i < 3; ++i){
        cost += A[i] - A[i-1];
    }

    printf("%d", cost);

    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
W = [0 for i in range(N)]
X = [0 for i in range(N)]
for i in range(M):
    l,r = map(int, input().split())
    W[l] += 1
    X[r-1] += 1

score = 0
for i in range(N):
    if W[i] >= 1 and X[i] >= 1:
        score += 1

if score == 0:
    score = 1

print(score)

Submission status: Runtime Error

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

print(cost)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

a.list()

print(+a[i+2]- a[i])
# -*- coding: utf-8 -*-

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

a.list()

print(+a[i+2]- a[i])

Submission status: Runtime Error

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

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

a.list()

print(+a[i+2]- a[i])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split());x=y=0
for(a,b)in sorted([list(map(int,input().split()))for i in range(m)],key=lambda x:x[1]):
 if a>x:
  x=b-1
  y+=1
print(y)

Submission status: Runtime Error

Solution code:
input();print(sum(int(a)-1for i in input().split()))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a=input();print(eval(max(a)+"-"+min(a)))

Submission status: Runtime Error

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

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

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

Solution code:
N=int(input())
import fractions 
print(2*N//fractions.gcd(2,N))

Submission status: Runtime Error

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

print(int(k - l)

Submission status: Runtime Error

Solution code:
n,m = [int(i) for i in input().split()]
e = [[int(j) for j in input().split()] for i in range(m)]
sorted(e,key= lambda x : x[1])
s=[]
for i in e:
  if s!=[]:
    if i[0]<=s[-1]:
    	pass
    else:
    	s.append(i[1]-1)
    
print(len(s))

Submission status: Runtime Error

Solution code:
n,m = [int(i) for i in input().split()]
e = [[int(j) for j in input().split()] for i in range(m)]
sorted(e,key= lambda x : x[1])
s=[]
for i in e:
  if s!=[] and i[0]<=s[-1]:
    pass
  else:
    s.append(i[1]-1)
    
print(len(s))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
T=input()
T_0_equal=[]
for i in range(len(S)):
  if(T[0]==S[i]):
    T_0_equal.append(i)
#print(T_0_equal)
for i in range(len(T_0_equal)):
  count=0
  for j in range(len(S)):
    if(T[j]!=S[(j+T_0_equal[i])%len(S)]):
      break
    else:
      count+=1
  if(count==len(S)):
  	print('Yes')
  	exit()
print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import fractions

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

def lcm(x, y):
  return x * y // fractions.gcd(x, y)

l = 1
for a in A:
  l = lcm(a, l)
B = [(l - 1) % a for a in A]
print(sum(B))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=list(int(input()))
s=s.sorted()
print(s[1]-s[0])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
from functools import reduce
n = (int)(input())
a = (list)(map(int, input().split()))


def calcMod(a, m):
  return sum([m % v for v in a])


def mul(a, b):
  return a*b


#print(calcMod(a, reduce(mul, a)-1))
print(sum(a)-n)

Submission status: Runtime Error

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

mini = list.pop(min(list))
ans = mini + min(list)

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input().split()

a.sort()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: 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())
a.sort()
print(a[2]-a[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
lst = map(int, raw_input().split())

print(max(lst)-min(lst

Submission status: Runtime Error

Solution code:
S = input()
T = input()

for i in range(len(S)):
    s=S[-i:]+S[0:-i]
    if s==T:
        print('Yes')
        break
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(a[2]-[0])