Problem:
 Score : 200 points    Problem Statement You are given an integer sequence A of length N .
Find the maximum absolute difference of two elements (with different indices) in A .      Constraints  2 \leq N \leq 100  1 \leq A_i \leq 10^9  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  A_1  A_2  ...  A_N       Output Print the maximum absolute difference of two elements (with different indices) in A .        Sample Input 1 4
1 4 6 3      Sample Output 1 5  The maximum absolute difference of two elements is A_3-A_1=6-1=5 .       Sample Input 2 2
1000000000 1      Sample Output 2 999999999       Sample Input 3 5
1 1 1 1 1      Sample Output 3 0

Solution (Python):
import math
import copy
import sys

def rotation(s):
    rot = []
    for i in range(1, len(s)):
        rot.append(s[i])

    rot.append(s[0])

    return rot

inputa = input().split()
inputb = input().split()


a = int(inputa[0])




















b = [int(n) for n in inputb]





max = 0

for i in range(a):
    for j in range(i+1, a):
        tmp = abs(b[i]- b[j])

        if tmp > max:
            max = tmp

print(max)

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

max_num = -1
min_num = 10000000000

for i in range(N):
    num = a_list[i]
    if num > max_num:
        max_num = num
    if num < min_num:
        min_num = num

print(max_num - min_num)

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

li = list(map(int,input().split()))
ans=[];count=[]



mx=li[0];mn=li[0]
for i in range(1,n) :
  cr=li[i]
  if cr>mx :
    mx=cr
  if cr< mn :
    mn=cr
    
print(abs(mx-mn))

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

li = list(map(int,input().split()))
ans=[]
li.sort(reverse=True)

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

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

l.sort()

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

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

Solution (Python):
Num = int(input())
Num_Array = list(map(int,input().split()))
Max_Num = -1
Min_Num = 1000000000000

for i in range(0,Num):

    if Num_Array[i] > Max_Num:
        Max_Num = Num_Array[i]

    if Num_Array[i] < Min_Num:
        Min_Num = Num_Array[i]

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

for num in num_list:
  temp = [abs(temp_num-num) for temp_num in num_list]
  diff_list+=temp
print(max(diff_list))

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

max = 0
min = 10000000000000000000

for i in range(N):
    if max < A[i]:
        max = A[i]

for i in range(N):
    if min > A[i]:
        min = A[i]
       
print(max-min)

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 = 0
for i in range(N - 1):
    for j in range(N):
        ans = max(ans, abs(A[i] - A[j]))
        
print(ans)

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

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

Solution (Python):
N = int(input())
lst = list(map(int, input().split()))
ans = []
for i in range(len(lst)-1):
  for j in range(i+1,len(lst)):
  	ans.append(abs(lst[i] - lst[j]))
print(max(ans))

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

print(max(int_list) - min(int_list))

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

for i in range(n):
	for j in range(n-i):
		
		d_list.append(abs(a_list[i]-a_list[n-j-1]))
		
print(max(d_list))

Solution (Python):

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

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

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

print(max(b) - min(b))

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

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

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

Solution (Python):
N = int(input())
A = input().split()
A = sorted(A, key = int)
print(int(A[N-1]) - int(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=[int(i) for i in 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()))

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans = max(ans, abs(A[i]-A[j]))
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()))
ma = 0
for i in range(n):
    for j in range(i + 1, n):
        ma = max(ma, abs(a[i] - a[j]))
print(ma)

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 = sorted(list(map(int,input().split())))
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 = str(input())
max = 0
min = 1000000000

list = A.split()

for i in list:
    i = int(i)
    if i > max:
        max = i
    if i < min:
        min = i

print(max- min)

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()))
list.sort(A)

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

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

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

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

diff_max = max(num_list) - min(num_list)

print(diff_max)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
min_a = 10**9
max_a = 1
for i in a:
    if i < min_a:
        min_a = i
    if i > max_a:
        max_a = i
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()))
ma=max(a)-min(a)
print(ma)

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

Solution (Python):

N = int(input())
lst_num = input().rstrip().split()

lst_rec = []
for i in range(N):
  target = int(lst_num[i])
  lstCnt = i + 1
      
  while True:
    if N  <= lstCnt : break
    
    diff = abs(target - int(lst_num[lstCnt]))
    lst_rec.append(diff)
    lstCnt += 1

print(max(lst_rec))

Solution (Python):
def INT(): return int(input())
def LIST(): return list(map(int, input().split()))
 
 
def main():
    N = INT()
    A = LIST()
    print(max(A)-min(A))
 
 
if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))

ans = A.max() - A.min()
print(ans)

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

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

Solution (Python):

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

Solution (Python):
line = raw_input()
n = int(line)
line = raw_input()
a = [int(s) for s in line.split(' ')]
ret = max(a) - min(a)
print ret

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

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

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

mx = 0
mi = 10**10

for i in range(N):
    if A[i] > mx:
        mx = A[i]
    if A[i] < mi:
        mi = A[i]

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

Solution (Python):
n = int(input())
a_list = [int(i) for i in input().split(" ")]
diff_list = []
for i in range(len(a_list)):
    for j in range(i+1,len(a_list)):
        diff_list.append(abs(a_list[i]-a_list[j]))
print(max(diff_list))

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

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

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

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

minimum = float('inf')
maximum = 0

for i in A:
	if i > maximum:
		maximum = i
	if i < minimum:
		minimum = i

print(maximum - minimum)

Solution (Python):

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

def solve(x, xs):
    res = []
    for y in xs:
        res.append(abs(x - y))
    if len(xs) > 2:
        res += solve(xs[0], xs[1:])
    return res

print(max(solve(xs[0], xs[1:])))

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

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

ans = 0
for i in range(N):
    for j in range(i, N):
        ans = max(ans, abs(A[i] - A[j]))

print(ans)

Solution (Python):
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())
li = list(map(int, input().split()))
ans = 0
for i in li:
    for j in li:
        if abs(i - j) > ans:
            ans = abs(i-j)

print(ans)

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

res = 0
for i in range(N):
    for j in range(i+1,N):
        diff = abs(A[i] - A[j])
        if diff > res:
            res = diff
print(res)

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

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

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

print(max(b) - min(b))

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

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

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

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

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

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

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

print(ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
print(abs(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())
aLst = list(map(int, input().split()))

aLst.sort()
tmpMin = aLst[0]
tmpMax = aLst[N - 1]
ans = tmpMax - tmpMin
print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
max_abs_diff = 0
for i in range(N-1):
    for j in range(i+1, N):
        abs_diff = abs(A[i]- A[j])
        if max_abs_diff < abs_diff:
            max_abs_diff = abs_diff
print(max_abs_diff)

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 = 0
for i in range(n):
    for j in range(i+1, n):
        dist = abs(a[j] - a[i])
        if dist > ans:
            ans = dist

print(ans)

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

ans = 0
for i in range(n):
    for j in range(i+1, n):
        dist = abs(a[j] - a[i])
        if dist > ans:
            ans = dist

print(ans)

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

ans = 0
for i in range(n):
    for j in range(i+1, n):
        dist = abs(a[j] - a[i])
        if dist > ans:
            ans = dist

print(ans)

Solution (Python):
def main():
    n = int(input())
    a = list(map(int,input().split()))
    ma = 0
    mi = 10000000000
    for i in a:
        ma = max(ma,i)
        mi = min(mi,i)
    print(ma-mi)

main()

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

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

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    N = int(input())
    a = list(int(_) for _ in input().split())
    print(max(a)-min(a))
    
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):
import sys
INPUT = sys.stdin.readline

def SORO_INT(): return int(INPUT())
def MULT_INT_LIST(): return list(map(int, INPUT().split()))
def MULT_INT_MAP(): return map(int, INPUT().split())
def SORO_STRING(): return INPUT()
def MULT_STRING(): return INPUT().split()

N = SORO_INT()
A = list(MULT_INT_MAP())
x = max(A) - min(A)
print(x)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    n = II()
    if n % 2:
        print(2 * n)
    else:
        print(n)
    return


def B():
    n = II()
    a = LI()
    a.sort()
    print(a[n-1]-a[0])
    return


def C():
    return


def D():
    return


if __name__ == '__main__':
    B()

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(i) for i in input().split()]
min = A[0]
max = 0
diff = 0
for i in range(N):
  if(A[i] <= min):
    min = A[i]
    diff = max - min
  if(A[i] >= max):
    max = A[i]
    diff = max - min
print(diff)

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

ans = -1
N = INT()
A = LIST()
C = list(combinations(A, 2))
for c in C:
    a, b = c
    if ans < abs(a - b):
        ans = max(ans, abs(a - b))
print(ans)

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

numsStr = input().split()
nums = []
for i in numsStr:
    nums.append(int(i))


ans = max(nums) - min(nums)
print(ans)

Solution (Python):
N = int(input())
As = list(map(int,input().split()))
r = []
for x in range(N):
  for y in range(x+1, N):
    r.append(abs(As[x]-As[y]))
print(max(r))

Solution (Python):
N = int(input())
A = [int(s) for s in 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 a:
    for j in a:
        ans = max(ans, abs(i - j))
print(ans)

Solution (Python):
N = int(input())
A = [int(i) for i in input().split(" ")]
ans = 0
for i in range(N):
    for j in range(i,N):
        ans = max(ans,abs(A[i]-A[j]))
print(ans)

Solution (Python):
from itertools import combinations

n = int(input())
ls = list(map(int, input().split()))
res = -1

for i, j in combinations(ls, 2):
    res = max(res, abs(i-j))
print(res)

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

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

b = sorted(a)
c = abs(b[-1] - b[0])

print(c)

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

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

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

lis.sort()

print(lis[len(lis)-1] - lis[0])

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

Solution (Python):
import sys

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

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

    al.sort()

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

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

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

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):
from itertools import combinations
n = int(input())
a = list(map(int, input().split()))
ans = 0

for i, j in combinations(a, 2):
    ans = max(ans, abs(i - j))
print(ans)

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

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

Solution (Python):
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):
a = int(input())
items = input().split(" ")
nums = []
for i in range(a):
  nums.append(int(items[i]))
max_num = max(nums)
min_num = min(nums)
print(max_num - min_num)

Solution (Python):

n = int(input())
a=list(map(int,input().split()))
dif_max=0
for i in a:
    for j in a:
        dif=abs(i-j)
        if dif>=dif_max:
            dif_max = dif

print(dif_max)

Solution (Python):
N = int(input())
getList = input().split(' ')
getList = [int(n) for n in getList]
print(int(max(getList)) - int(min(getList)))

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

Solution (Python):
N = int(input())
A = [int(zz) for zz in 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())

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




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

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

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

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

ans=[]
for i in range(n-1):
    for j in range(i+1,n):
        a=abs(nums[i]-nums[j])
        ans.append(a)
print(max(ans))

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

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

print(max(alist)-min(alist))

Solution (Python):
n = int(input())
num = sorted([int(x) for x in input().split()])

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

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

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

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

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

Solution (Python):



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

ans = 0
for i in range(1,N):
    for j in range(i):
        if ans < abs(A[i]-A[j]):
            ans = abs(A[i]-A[j])
print(ans)

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()))
ans = 0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        ans = max(ans,abs(a[i]-a[j]))
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())
a=list(map(int,input().split()))

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

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

x.sort()

res=abs(x[0]-x[n-1])

print(res)

Solution (Python):


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

print(max(As)- min(As))

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

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

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
As = nl()

max_diff = 0
for i in range(N-1):
    for j in range(i+1, N):
        diff = abs(As[i] - As[j])
        if diff > max_diff:
            max_diff = diff
print(max_diff)

Solution (Python):
N = int(input())
A = [int(i) for i in 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()))


maxi = 0

for i in A:

    for j in A:

        if i <= j and j - i > maxi:
            maxi = j - i

        elif i >= j and i - j > maxi:
            maxi = i - j

print (maxi)

Solution (Python):
import itertools

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

ans = 0
for combi in itertools.combinations(a_list, 2):
    ans = max(ans, abs(combi[1] - combi[0]))
print(ans)

Solution (Python):
n=int(input())
li = list(map(int,input().split()))
if(li[0]>li[1]):
    max=li[0]
    min=li[1]
else:
    max=li[1]
    min=li[0]
for i in range(2,n):
    if(li[i]>max):
        max=li[i]
    if(min>li[i]):
        min=li[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=[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(abs(A[0]-A[-1]))

Solution (Python):
from itertools import combinations

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

ans = 0
for n1, n2 in combinations(a, 2):
  ans = max(ans, abs(n1 - n2))

print(ans)

Solution (Python):



import sys

input = sys.stdin.readline

def main():
    N = int(input())
    A = [int(e) for e in input().split()]

    n = 0
    for i in range(N):
        for j in range(i+1, N):
            n = max(n, abs(A[j] - A[i]))
    print(n)

main()

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

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

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

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

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


abc()

Solution (Python):

numbers = int(input())


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



max = 0



for number in range(numbers):
	
	for number2 in range(numbers):
		result = list_numbers[number]-list_numbers[number2]
        
		if result < 0:
			result = -1*result
        
		if result > max:
			max = result

print(max)

Solution (Python):

n = int(input())

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

m = 0

for i in range(n):
  for j in range(i, n):
    m = max(m, abs(a[i] - a[j]))

print(m)

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

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

mi = min(lst)
mx = max(lst)

print(abs(mx-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()))
i = 0
B = 0
C = 100000000000000
D = 0


while("Treu"):
    if B < A[i]:
        B = A[i]
    if C > A[i]:
        C = A[i]
    i+=1
    if i == N :
        break
D = B - C
print(abs(D))

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

Solution (Python):

N = int(input())

list = input().split(" ")

num_list = []

for element in list:
    num_list.append(int(element))

min = 1000000001
max = 0

for num in num_list:
    if num >= max:
        max = num
    if num <= min:
        min = num

print(max - min)

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

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

imax = max(listi)
imin = min(listi)

print(imax - imin)

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")

N = int(sys.stdin.readline())
A = np.array(list(map(int, sys.stdin.readline().split())))

print(abs(A).max() - abs(A).min())

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

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

print(max(c)-min(c))

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

ans = 0
for i in range(n):
    for j in range(n):
        ans = max(ans, abs(a[i]-a[j]))

print(ans)

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

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

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

N, = map(int, input().split())
L = [int(v) for v in input().split()]

print(abs(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_s = [int(v) for v in input().split()]
ans = max(a_s) - min(a_s)

print(ans)

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()))
li.sort()
print(li[-1]-li[0])

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

m = 0
for i in range(n):
  for j in range(n):
    m = max(m, abs(a[i]-a[j]))
print(m)

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

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

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

print(max([abs(x[0] - x[1]) for x in itertools.combinations(A, 2)]))

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