Problem:
 Score : 200 points    Problem Statement It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts. There are N houses along TopCoDeer street . The i -th house is located at coordinate a_i . He has decided to deliver gifts to all these houses. Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.      Constraints  1 ≤ N ≤ 100  0 ≤ a_i ≤ 1000  a_i is an integer.         Input Input is given from Standard Input in the following format:  N  a_1  a_2  ...  a_N       Output Print the minimum distance to be traveled.        Sample Input 1 4
2 3 7 9      Sample Output 1 7  The travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2 . It is not possible to do with a travel distance of less than 7 , and thus 7 is the minimum distance to be traveled.       Sample Input 2 8
3 1 4 1 5 9 2 6      Sample Output 2 8  There may be more than one house at a position.

Solution (Python):
N = int(input())
houses = list(map(int, input().split()))
houses.sort()
distance = 0
for i in range(N-1):
    distance += houses[i+1] - houses[i]
print(distance)

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

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

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

Solution (Python):

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

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

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

Solution (Python):
n=int(input())
a_list=list(map(int,input().split()))
a_list.sort()
ans=0

for i in range(n-1):
    ans=ans+a_list[i+1]-a_list[i]
    
print(ans)

Solution (Python):



def main():
    """Function."""
    n = int(input())
    a = list(map(int, input().split()))
    print(max(a) - min(a))


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    _ = input()
    aa = sorted(map(int, input().split()))
    print(aa[-1] - aa[0])


if __name__ == '__main__':
    main()

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

Solution (Python):
n=input()
a=sorted(map(int,input().split()))
print(a[-1]-a[0])

Solution (Python):
N = int(input())
place = [int(i) for i in input().split()]
place.sort()
print(place[-1] - place[0])

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

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

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

Solution (Python):
N = int(input())
a = sorted([ int(i) for i in input().split()])
l = 0
for i in range(1, len(a)):
    l += a[i]-a[i-1]
print(l)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
max=-10000
min=10000
for i in range(N):
    if a[i] < min:
        min=a[i]
    if a[i] > max:
        max=a[i]
print(str(max-min))

Solution (Python):
N=int(input())
a=input().strip().split(" ")
a=[int(i) for i in a]
a.sort()

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

Solution (Python):

_ = int(input())
lst = list(map(int, input().split()))
print(max(lst) - min(lst))

Solution (Python):
n = int(input())
a = input().split()
a = [int(m) for m in a]
print(max(a) - min(a))

Solution (Python):
n = int(input())
home_list = list(map(int, input().split()))
home_list.sort()
print(home_list[n-1] - home_list[0])

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
print(b[len(a)-1]-b[0])

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

print(num)

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

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

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

a.sort()
p = a[0]
ans = 0

for i in a:
	if p == i:
		continue
	ans += i - p
	p = i
	
print(ans)

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

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

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

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

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

Solution (Python):
N = int(input().rstrip())
a = list(map(int, input().rstrip().split()))
a.sort()
result = 0
if 1 < len(a):
    result = a[-1] - a[0]


print(result)

Solution (Python):
a = int(input())
count = 0
ar = list(map(int,input().split(" ")))
br = sorted(ar,reverse=True)
for i in range(a-1):
    count += br[i] - br[i+1]
print(count)

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

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

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

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

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

Solution (Python):
size_number = input()
a = map(int, raw_input().split())
max = -1000
min = 99999
for i in range(size_number):
    if(max < a[i]):
        max = a[i]
    if(min > a[i]):
        min = a[i]
print(max - min)

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A.sort()
A_dif = [A[i+1]-A[i] for i in range(N-1)]
print(sum(A_dif))

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

print(li[n-1]-li[0])

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

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

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

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

Solution (Python):
input();l=sorted(list(map(int,input().split())));print(l[-1]-l[0])

Solution (Python):
n = int(input())
a = sorted(list(map(int, input().split())))
ans = [a[i]-a[i-1] for i in range(n-1, 0, -1)]
print(sum(ans))

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

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

Solution (Python):
N = int(input())
array = list(map(int, input().strip().split(' ')))
num = sorted(array)
ans = num[-1] - num[0]
print(ans)

Solution (Python):
n = int(input())
a = [int(_) for _ in input().split()]

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

Solution (Python):


n=int(input())
l = list(map(int, input().split()))
l.sort()
print(l[len(l)-1]-l[0])

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

Solution (Python):
from sys import stdin
from sys import maxsize


def main() -> int:
    n = next_int()
    lowest = maxsize
    highest = 0

    for _ in range(n):
        ai = next_int()
        lowest = min(lowest, ai)
        highest = max(highest, ai)

    print(highest - lowest)
    return 0


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
n = int(input())
left = 1e9
right = -1
A = list(map(int, input().split()))
'''
A = [input() for i in range(n)]
for i in range(n) :
    A = list(map(int, input().split()))'''
for i in range(n) :
    left = min(A[i], left)
    right = max(A[i], right)
print(right - left)

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

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

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

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

Solution (Python):
n = input()
a = list(map(int, input().split(" ")))

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

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

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

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

listA.sort()
print(listA[len(listA)-1]-listA[0])

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

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

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

Solution (Python):
n = int(input())

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

a.sort(reverse = True)



ans = 0

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


print(ans)

Solution (Python):
n = int(input())
list_a = list((map(int, input().split())))
list_a.sort()
print(list_a[-1] - list_a[0])

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

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

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

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

Solution (Python):
N=int(input())
S=list(map(int,input().split()))
S.sort()
print(S[-1]-S[0])

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

a.sort()
print(a[n-1] - a[0])

Solution (Python):
import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
a = list(li())

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

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

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

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
N = int(input())
a_list = list(map(int, input().split()))

max_num = max(a_list)
min_num = min(a_list)
print(max_num-min_num)

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

Solution (Python):
N = int( input())
A = list( map( int, input().split()))
A.sort()
print(A[-1] - A[0])

Solution (Python):


N = int(input())
a = list(map(int, input().split()))
mi = a[0]
ma = a[0]
for i in range(1,N):
    if a[i] < mi:
        mi = a[i]
    elif a[i] > ma:
        ma = a[i]
print(ma-mi)

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

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

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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD




dp = None


def main():
    N = int(input())
    A = li_input()

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


main()

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

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

Solution (Python):
N = int(input())
aList = list(map(int, input().split()))

print(max(aList) - min(aList))

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

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

Solution (Python):



def main():
    N = input()
    a = [int(ele) for ele in raw_input().split()]
    a.sort()
    print(a[-1] - a[0])



if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD




dp = None


def main():
    N = int(input())
    A = li_input()

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


main()

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

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

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

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

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

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

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):
def solve():
    n = int(input())
    lists = list(map(int, input().split()))

    lists = sorted(lists)
    result = lists[-1] - lists[0]
    print(result)

solve()

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

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

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

Solution (Python):
N = int(input())
a = [int(v) for v in input().split()]
print(max(a) - min(a))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0

for i in range(0,n-1):
    ans+=(a[i+1]-a[i])

print(ans)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0

for i in range(0,n-1):
    ans+=(a[i+1]-a[i])

print(ans)

Solution (Python):


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

    print(max(a_list) - min(a_list))

if __name__ == '__main__':
    main()

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

Solution (Python):
N=int(input())
l=sorted(map(int,input().split()))
print(l[-1]-l[0])

Solution (Python):

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

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

print(max(aa)-min(aa))

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

Solution (Python):
n = input()
a = list(map(int, input().split(" ")))

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

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

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

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

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

Solution (Python):
s = raw_input()
l = [int(x) for x in raw_input().split()]
print max(l) - min(l)

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

Solution (Python):
N = int(input())
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)

Solution (Python):
n=int(input())

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

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

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

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

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

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

Solution (Python):
n = int(input())
x = list(map(int, input().split()))
x.sort()
print(x[len(x) - 1] - x[0])

Solution (Python):


n = int(input())
A = list(map(int, input().split()))
print(max(A)-min(A))

Solution (Python):
"""
https://abc064.contest.atcoder.jp/tasks/abc064_b
"""
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
print(a[len(a)-1]-a[0])

Solution (Python):
N = int(input())
li = list(map(int,input().split()))
li.sort()
cnt = li[0]
ans = 0
for i in li:
    ans += abs(cnt - i)
    cnt = i

print(ans)

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

Solution (Python):
n = int(input())
arr = map(int,raw_input().split())

print max(arr)-min(arr)

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

Solution (Python):

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

ans = max(A) - min(A)

print(ans)

Solution (Python):


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

aN.sort()

print(aN[N-1] - aN[0])

Solution (Python):
n=int(input())
code=input().split()
mi=1001
ma=0
for i in range(n):
    mi=min(mi,int(code[i]))
    ma=max(ma,int(code[i]))
print(ma-mi)

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

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

Solution (Python):
a=int(input())
list=input().split(" ")
for i in range (len(list)):
    list[i]=int(list[i])
print(max(list)-min(list))

Solution (Python):
n=int(input())
x=input().split()
y=0
while y<n:
    x[y]=int(x[y])
    y+=1
x.sort()
print(int(x[-1]-x[0]))

Solution (Python):
N = int(input())
input_list = [int(i) for i in input().split()]

print(max(input_list)-min(input_list))

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

nums = sorted(a)
print(nums[len(nums)-1] - nums[0])

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

if n == 1:
    print(0)
else:
    print(max(a) - min(a))

Solution (Python):
N=int(raw_input())
a=map(int,raw_input().split())
a.sort()
print a[-1] - a[0]

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

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

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

Solution (Python):
n = int(input())
x = [int(i) for i in input().split()]
print(max(x)-min(x))

Solution (Python):
N = int(input())
houses = list(map(int, input().split()))
houses.sort(reverse=True)

res = 0
for i in range(N-1):
    res += houses[i] - houses[i+1]
print(res)

Solution (Python):
n=int(input())
dist=sorted([int(x) for x in input().split()])
print(dist[-1]-dist[0])

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

Solution (Python):
N=int(input())
location = list(map(int, input().split()))
location.sort()
distance = 0
for i in range(0, N-1):
    distance += location[i+1] - location[i]
print(distance)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
print('{}'.format(max(a)-min(a)))

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

Solution (Python):
N = int(input())
achar = input().split()
a = []
for i in range(N):
    a.append(int(achar[i]))

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

Solution (Python):
N = raw_input()
norm = raw_input()
j = [int(i) for i in norm.split(" ")]

j.sort()
j.reverse()

dist = j[0] - j[-1]

print(dist)

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

Solution (Python):
N=int(input())
ie=input().split()
ie1=list(map(int,ie))
ie1.sort()
print(ie1[N-1]-ie1[0])

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

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

a_s = sorted(a)

print(a_s[n-1] - a_s[0])

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

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

Solution (Python):
N=int(input())
A=[int(x) for x in input().split()]
print(max(A)-min(A))

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

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

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

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

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

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

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

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))[:N]

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

Solution (Python):

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

print(max(LIST) - min(LIST))

Solution (Python):
N = int(input())
cor_list = list(map(int, input().split()))
sort_cor_list = sorted(cor_list)
print(sort_cor_list[-1]- sort_cor_list[0])

Solution (Python):
import math
import sys

def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])

arr=sorted(list(map(int, arr_data[1])))

print(arr[-1:][0]-arr[0])

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

Solution (Python):
n = int(input())
a = input().split()
a.sort()
print(int(a[n - 1]) - int(a[0]))

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

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

Solution (Python):
_ = input()
a = sorted(map(int, input().split()))
print(a[-1] - a[0])

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

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
c = 0
for i in range(n - 1):
    c += a[i + 1] - a[i]
print(c)

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

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

Solution (Python):





if __name__ == '__main__':
    house_count = int(input())
    coordinates = list(map(int, input().split()))
    print(max(coordinates) - min(coordinates))

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

Solution (Python):
_ = input()
l = sorted(list(map(int, input().split())))
print(l[-1] - l[0])

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

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

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
uniq_a = list(set(a))
uniq_a.sort()
ans = 0
for i in range(len(uniq_a)-1,0,-1):
    ans += uniq_a[i]-uniq_a[i-1]
print(ans)

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

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

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

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

Solution (Python):
N=int(input())
ai=list(map(int,input().split()))
ai.sort()
print(ai[-1]-ai[0])

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

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

max = 0
min = 1005
for i in a:
    if(i > max):
        max = i
    if(i < min):
        min = i

print(max - min)

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

Solution (Python):
N=int(input())
A=set(map(int, input().split()))
Al=list(A)
Al.sort()
print(Al[-1]-Al[0])

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

print(max(xs) - min(xs))

Solution (Python):
N = int(input())
L=input().split(' ')
Lint = []
for i in L:
    Lint.append(int(i))
Lint.sort()
print(str(Lint[-1]-Lint[0]))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
sum = 0

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

print(sum)

Solution (Python):
n=int(input())
a=sorted([int(x) for x in input().split()])
print(a[-1]-a[0])

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

Solution (Python):
input()


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

a = min(xs)
b = max(xs)

print(b-a)

Solution (Python):
ignore = input()
l = map(int, raw_input().split())
l.sort()
counter = 0
for i in range(1,len(l)):
    counter = counter + l[i]-l[i-1]

print counter

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

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

print(max(house) - min(house))

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

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

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
P.sort()
print(P[N-1]-P[0])