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())
a = list(map(int,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 = sorted(list(map(int, input().split())))
print(a[-1]-a[0])

Solution (Python):


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


descending_a = sorted(a, reverse=True)



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

Solution (Python):
def minimum_dist(l1: list) -> int:
    return max(l1) - min(l1)


if __name__ == "__main__":
    n = int(input())
    list_coordinate = list(map(int, input().split()))
    print(minimum_dist(list_coordinate))

Solution (Python):


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


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

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

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

max = 0
min = 1000

for i in range(len(point)):
    if max < point[i]:
        max = point[i]
    if min > point[i]:
        min = point[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 = input()
data = list(map(int, input().split()))

max = max(data)
min = min(data)

print(max - min)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[len(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 = sorted(set(list(map(int, input().split()))))
print(a[-1]- a[0])

Solution (Python):

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

a1=max(a)
a2=min(a)

print(a1-a2)

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()
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())
lst = input().split()

for i in range(N):
   lst[i] = int(lst[i])

print(max(lst) - min(lst))

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()))
print(max(a)-min(a))

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

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

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

Solution (Python):

S_list = [input() for i in range(2)]
N = map(int,S_list[0].split())    
A_list = list(map(int,S_list[1].split()))

print(max(A_list)-min(A_list))

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

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

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

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

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

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

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

distance = 0

for i in range(N - 1):
    distance += a[i + 1] - a[i]

print(distance)

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

print((max(home))-(min(home)))

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

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

Solution (Python):
def main():
    N = int(input())
    a = list(map(int,input().split()))
    a.sort()
    ans = 0
    
    for i in range(1,N,1):
        ans += a[i] - a[i-1]

    return ans

print(main())

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

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

Solution (Python):
import sys

input = sys.stdin.readline
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()))
ans = max(A)-min(A)
print(ans)

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

Solution (Python):
from sys import stdin
rs = lambda : stdin.readline().strip()
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    N = ri()
    a = ril()
    print(max(a) - min(a))


if __name__ == '__main__':
    main()

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

print(max(arr) - min(arr))

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

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

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

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):
total_house = int(input())
house_coordinate = sorted(list(map(int, input().split())))
print(house_coordinate[total_house - 1] - house_coordinate[0])

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

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

Solution (Python):

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

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



if __name__ ==  "__main__":
    main()

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

MAX = max(A)
MIN = min(A)

print(MAX-MIN)

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

print(max(list02) - min(list02))

Solution (Python):
N = int(input())
a = sorted([int(x) for x 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):
home_num = int(input())
house_from = list(map(int,input().split()))

print(max(set(house_from)) - min(set(house_from)))

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

A.sort()

print(A[-1] - A[0] if N > 1 else 0)

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

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

distance = 0

for i in range(N - 1):
    distance += a[i + 1] - a[i]

print(distance)

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

distance = max(a)-min(a)

print(distance)

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


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

Solution (Python):



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

my_list_sort = sorted(my_list)
answer = my_list_sort[-1] - my_list_sort[0]

print(answer)

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

print(max(Ni)-min(Ni))

Solution (Python):

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

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

result = max(points) - min(points)
print(result)

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

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



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

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

print(max(coordinates) - min((coordinates)))

Solution (Python):

homecnt = int(input())
homeplace = list(map(int,input().split()))


dist = max(homeplace) - min(homeplace)
print(dist)

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

Solution (Python):
N=int(input())
a=str(input())

def ans064(N:int, a:str):
    a_list=sorted(map(int,a.split()))
    return(a_list[-1]-a_list[0])

print(ans064(N,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):
N = int(input())
A = list(map(int, input().split()))
print(max(A) - min(A))

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

def answer(n:int, a:list)->int:
    return max(a)-min(a)

print(answer(n,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()
a = list(map(int,input().split()))
a.sort()
print(a[-1]-a[0])

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

print(max(house_list) - min(house_list))

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

Solution (Python):
def answer(n: int, a: []) -> int:
    return max(a) - min(a)


def main():
    n = int(input())
    a = list(map(int, input().split()))
    print(answer(n, a))


if __name__ == '__main__':
    main()

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

max_v = max(a)
min_v = min(a)

print(max_v - min_v)

Solution (Python):
import sys



def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


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


def main():
    n = input_int()
    A = input_int_list()
    print(max(A) - min(A))
    return


if __name__ == "__main__":
    main()

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

Solution (Python):
with open(0) as f:
    N, *a = map(int, f.read().split())
print(max(a)-min(a))

Solution (Python):
def atc_064b(input_value: str) -> str:
    N = input_value[0]
    ai = [int(i) for i in input_value[1].split(" ")]
    return max(ai) - min(ai)

N = input()
ai = input()
print(atc_064b([N, ai]))

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

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()))
x = max(A)
y = min(A)
print(x - y)

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

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

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

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())
ary = sorted(list(map(int, input().split())))
print(ary[-1] - ary[0])

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

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

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

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

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


a = set(a)
a = list(a)
a = sorted(a)

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

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()))
print(max(a)-min(a))

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

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

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

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


print(max(al)-min(al))

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

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    a = list(map(int, readline().split()))
    a.sort()

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


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())
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())
a=list(map(int,input().split()))
a.sort()
print(a[n-1]-a[0])

Solution (Python):
from typing import List


N: int = 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
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2 3 7 9"""
        output = """7"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """8
3 1 4 1 5 9 2 6"""
        output = """8"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    a = list(map(int, input().split()))

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


if __name__ == "__main__":
    
    resolve()

Solution (Python):


num = int(input())
str = input().split()
table = [int(i) for i in str]
list.sort(table)
print(table[num-1] - table[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):
n = int(input())
a = list(map(int, input().split()))

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

Solution (Python):
a=input()
a=int(a)
b=list(map(int,input().split()))
b.sort()
print(b[a-1]-b[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()))

distance=max(A)-min(A)
print(distance)

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 = list(map(int, input().split()))
a.sort()
print(a[len(a) - 1] - a[0])

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()
    num_list = i_list()

    num_list.sort()

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

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

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

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

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

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

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

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

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

Solution (Python):

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

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

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

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

points.sort()
start = points[0]
cnt = 0
for i in points:
    cnt += i -start
    start = i

print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
n = int(input())
l = sorted(list(map(int,input().split())))
print(l[-1]-l[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):
N = int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))

Solution (Python):
n = raw_input()
ais = map(int, raw_input().split())
print max(ais) - min(ais)

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
li = rl()
print(max(li) - min(li))

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    print(max(A)-min(A))


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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

if __name__ == "__main__":
    main()

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

Solution (Python):









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

a.sort()

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

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

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

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

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

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

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

















import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
a = sorted(MAP())
print(a[-1] - a[0])

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
a = LI()
a.sort()
print(abs(a[0]-a[-1]))

Solution (Python):
_ = input()
A = sorted(int(T) for T in input().split())
print(A[-1]-A[0])

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
al = sorted(set(a),reverse = 1)
ans = []
for i,j in zip(al[:-1],al[1:]):
    ans.append(i-j)
print(sum(ans))

Solution (Python):
N=int(input())
A=set(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())
arr = list(map(int, input().split()))
mn = 100000000
mx =0
for i in arr:
	mn = min(mn , i)
	mx = max(mx , i)

print(mx-mn)

Solution (Python):
N=input()
l=list(map(int,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=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()))
a.sort()
print(a[-1]-a[0])

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())
    A.sort()
    print(A[-1] - A[0])
    
    return


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())
A = sorted(list(map(int, input().split())))
print(A[-1]-A[0])

Solution (Python):
_,*aa = map(int, open(0).read().split())

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

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

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

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

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

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

a = sorted(a)
s = 0
for i in range(N-1):
    s += a[i+1] - a[i]

print(s)

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

Solution (Python):
input()
(*a,) = 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())
l = sorted(list(map(int, input().split())))
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())
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):
M = int(input())
LL = input().split()
list1 =[]
for i in LL:
  a = int(i)
  list1.append(a)
list1.sort()
print(list1[-1] -list1[0])

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

Solution (Python):
def actual(N, A):
    return max(A) - min(A)

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

print(actual(N, A))

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

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

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

house = []

p = input().split()
for i in range(n):
    q = int(p[i])
    house.append(q)

house.sort()

answer = house[n - 1] - house[0]

print(answer)

Solution (Python):
n=int(input())
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())
line = list(map(int,input().split()))
line.sort(key=int)
print(line[-1] - line[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 = sorted(A)
ans = A[-1] - A[0]

print(ans)

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

a = sorted(a)

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

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

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

print(max(nums) - min(nums))

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

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

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    D = il()
    print(max(D)-min(D))


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

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

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

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