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):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

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

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

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

Solution (Python):
n = int(input())
lst = list(map(int, input().split()))
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):
_,*l=map(int,open(0).read().split())
print(max(l)-min(l))

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    a = LI()

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

if __name__ == '__main__':
    resolve()

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()
    A = sorted(il())
    print(abs(min(A) - max(A)))


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import sys

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

def mi():
    return map(int, input().split())

def ii():
    return int(input())


def main():
    N = ii()
    a = list(mi())
    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(int,input().split()))
print(max(A)-min(A))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
now=a[0]
for i in a:
  ans+=i-now
  now=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):
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()))

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

if N < 0 or N > 100:
    sys.exit()
if not len(int_array) == N:
    sys.exit()
if max(int_array) > 1000 or min(int_array) < 0:
    sys.exit()

print(max(int_array) - min(int_array))

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

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


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


if __name__ == "__main__":
    main()

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

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

print(max(an) - min(an))

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

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()))	
ans=max(l)-min(l)
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=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[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())))
a.sort()
print(max(a)-min(a))

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

mi = min(s)
ma = max(s)

print(ma-mi)

Solution (Python):
import sys

input = sys.stdin.readline


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

    ans = max(a) - min(a)

    print(ans)


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

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

Solution (Python):
def resolve():
    n = int(input())
    pos = list(map(int, input().split()))
    pos.sort()

    ans = pos[-1] - pos[0]

    print(ans)
resolve()

Solution (Python):
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 = sorted(map(int, input().split()), reverse=True)
t = 0
for i in range(n-1):
    t += a[i] - a[i+1]
print(t)

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

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

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

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

Solution (Python):
def coordminmax(N) : 
  coordinate = list(map(int, input().split()))
  min = coordinate[0]
  max = coordinate[0]
  
  for i in range(len(coordinate)) : 
    if coordinate[i] < min : 
      min = coordinate[i]
      
    if coordinate[i] > max : 
      max = coordinate[i]
      
  return min, max

def calcdistance(N) : 
  min, max = coordminmax(N)
  return max - min


N = int(input())

print(calcdistance(N))

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

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

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

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

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

Solution (Python):
_,*a=map(int,open(0).read().split());print(max(a)-min(a))

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

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

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

Solution (Python):
n = int(input())
a = sorted([int(i) for i in 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 = 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())
a=list(map(int,input().split()))
x=max(a)
y=min(a)
s=x-y
print(s)

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

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())) 
ans = 0

for i in range(0,N-1):
  ans = ans + sorted(a)[i+1] - sorted(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()))
a.sort()
print(a[n-1]-a[0])

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

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

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

Solution (Python):

if __name__ == '__main__':
    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()
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()))

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

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

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



A=sorted(A)
ans=A[N-1]-A[0]
print(ans)

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

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

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

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

Solution (Python):
N = int(input())
st = list(set(map(int,input().split())))
total = 0
st.sort()

for i in range(len(st)-1):
    total += (abs(st[i]-st[i+1]))
print(total)

Solution (Python):
n = 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):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    L = sorted(lmi())
    print(L[-1] - L[0])



if __name__ == "__main__":
    main()

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

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

assert n == len(pos)

print(max(pos)-min(pos))

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[-1]-A[0])

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

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

h_max = max(h_point)
h_min = min(h_point)

ans = h_max - h_min
print(ans)

Solution (Python):

input()
pos = sorted(list(map(int, input().split())))
print(max(pos) - min(pos))

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

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

end = max(al)
sta = min(al)

print(end-sta)

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 = sorted(a)
print(A[-1] - A[0])

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






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






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def Yes(): print("Yes"); return
def No(): print("No"); return


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def Base_10_to_n(X, n):
  if X//n:
    return Base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def Base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





N = inputI()
a = inputIL()

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

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = sorted(list(map(int, input().split())))
    print(A[-1] - A[0])


if __name__ == '__main__':
    resolve()

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

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

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

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


def invr():
    return(map(int, input().split()))


n = inp()
arr = invr()
arr = sorted(arr)
d = 0
for i in range(n-1):
    d += arr[i+1] - arr[i]
print(d)

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

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

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

Solution (Python):

import sys


def solve(N: int, a: "List[int]"):
    b = sorted(a)
    return b[-1] - b[0]



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    a = [int(next(tokens)) for _ in range(N)]  
    print(solve(N, a))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

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

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

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

ans = max(a) - min(a)

print(ans)

Solution (Python):

"""
Created on Thu May 14 13:26:11 2020

@author: shinba
"""

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()))	
ans = max(li)-min(li)
print(ans)

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

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

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 = sorted(a)
ans = 0

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

print(ans)

Solution (Python):
import numpy as np
n = int(input())
l = np.array(sorted(list(map(int, input().split()))))

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

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

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

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

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

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

Solution (Python):
import sys
import math
import bisect

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

if __name__ == "__main__":
    main()

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

Solution (Python):
def main():
    n = int(input())
    As = list(map(int, input().split()))
    As = sorted(As)

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

    print(ans)


if __name__ == "__main__":
    main()

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

a.sort()

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

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

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

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

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

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, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
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
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 = LIST()
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 = list(map(int,input().split()))
print(max(a_list)-min(a_list))

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

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

Solution (Python):

import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**6)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7

N = ri()
a = ri_()
print(max(a) - min(a))

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

house = set(house)

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,sqrt
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7


n=I()
A=LI()
print(max(A)-min(A))

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

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7

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

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

print(alist[-1]-alist[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()))
a.sort()
summ=sum(a)
print(a[-1]-a[0])

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

if __name__ == '__main__':
    main()

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

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

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

a = sorted(a)

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(set(sorted([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()
ans = 0
for i in range(n - 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()))
ans=max(a)-min(a)
print(ans)

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

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

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

print(max(list) - min(list))

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

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

Solution (Python):

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

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

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



if '__main__' == __name__:
    resolve()

Solution (Python):


N = int(input())
S = list(map(int,input().split()))
m1=max(S)
m2 = min(S)
print(m1-m2)

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):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = na()

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