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):
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()))
m = -10*100


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

print(m)

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()]
k = len(a)
max = 0

for i in range(k):
    for j in range(i + 1, k):
        abs_ = abs(a[i] - a[j])
        if abs_ > max:
            max = abs_

print(max)

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

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

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

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    N = int(input())
    A = list(map(int,input().split()))
    ans = -INF
    for i in range(N):
        for j in range(i + 1,N):
            ans = max(ans,abs(A[i] - A[j]))
    print(ans)
if __name__ == '__main__':
    main()

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

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

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

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

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



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

print(dmax)

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

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

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

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

Solution (Python):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    res = abs(max(a) - min(a))
    print(res)
if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
n = int(input())
a = list(map(int , input().split()))
ans = 0
for ai in a:
    for bi in a:
        ans = max(ans, abs(bi - ai))
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 = 0
nans = 0
for i in range(n):
    for j in range(n):
        ans = abs(a[i] - a[j])
        if ans >= nans:
            nans = ans
print(nans)

Solution (Python):
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()
a = nl()
print(max(a)-min(a))

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

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

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

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):
        sa = abs(a[i]-a[j])
        ans = max(ans, sa)
print(ans)

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

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

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

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

while True:
    for i in range(N):
        a = abs(A[b] - A[i])
        if a > ans:
            ans = a
    b = b + 1
    if b == N - 1:
        break
    else :
        continue
    break      
print(ans)

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

lis.sort(reverse=True)

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

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

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
max = 0
for i in range(n):
    for j in range(i+1, n):
        if abs(A[i] - A[j]) > max:
            max = abs(A[i] - A[j])
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):
def resolve():
	n = int(input())
	a = list(map(int, input().split()))
	print(max(a) - min(a))
resolve()

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

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

max_value = max(A);
min_value = min(A);

sub = abs(max_value - min_value)

print(sub)

Solution (Python):
n=int(input())
a=[int(x) for x in 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):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = np.array(lr())
answer = A.max() - A.min()
print(answer)

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

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

Solution (Python):
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
l.sort()
print(l[-1]-l[0])

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

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 (int(X/n)):
    return Base_10_to_n(int(X/n), n)+[X%n]
  return [X%n]






N = inputI()
A = inputIL()
A.sort()

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):
input()
min_ = float('inf')
max_ = 0
for i in map(int, input().split()):
    if min_ > i:
        min_ = i
    if max_ < i:
        max_ = i
print(max_ - min_)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


n = I()
A = LI()
ans = -INF
for x, y in combinations(A, 2):
    ans = max(ans, abs(x-y))
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 = 0
for i in range(n):
    for j in range(i, n):
        ans = max(ans, abs(a[i]-a[j]))
        
print(ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(n):
        if i == j: continue
        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()))
d=[]
import itertools
for v in itertools.combinations(a,2):
    
    d.append(abs(v[0]-v[1]))
print(max(d))

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

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

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

Solution (Python):
import sys
import math
import bisect
import re

def solve(A):
    return max(A) - min(A)

def main():
    n = int(input())
    A = list(map(int, input().split()))
    print(solve(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())
l = list(map(int,input().split()))
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        ans = max(ans,abs(l[i]-l[j]))
print(ans)

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

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

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

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

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

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

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(abs(l[0]-l[-1]))
resolve()

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

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

Solution (Python):


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

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

if __name__ == '__main__':
    main()

Solution (Python):
from itertools import combinations

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

print(max([abs(pair[0] - pair[1])for pair in combinations(A, r=2)]))

Solution (Python):
import math

N = int(input())
A_num = list(map(int, input().split()))
sum = []
for i in range(N):
    for j in range(N):
        sum.append(math.fabs(A_num[i] - A_num[j]))

print(int(max(sum)))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ma = -1
mi = 1 + 10 ** 9
for i in range(n):
    if a[i] > ma:
        ma = a[i]
    if a[i] < mi:
        mi = a[i]
print(ma - mi)

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

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

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

max = max(list)
min = min(list)

print(max - min)

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

Solution (Python):
import fileinput

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

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    _ = 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()))

ans = abs(max(A) - min(A))

print(ans)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
max_abs = 0
for i in A:
    for j in A:
       max_abs = max(max_abs, abs(i - j))
print(max_abs)

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

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

MaxA = max(A)
MinA = min(A)

print(MaxA-MinA)

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

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

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

print(max(A_lis) - min(A_lis))

Solution (Python):
def actual(N, a_list):
    s = set(a_list)
    
    return max(s) - min(s)


N = int(input())
a_list = map(int, input().split())

print(actual(N, a_list))

Solution (Python):
def actual(N, a_list):
    s = set(a_list)
    num_max = max(s)
    num_min = min(s)

    return abs(num_max - num_min)


N = int(input())
a_list = map(int, input().split())

print(actual(N, a_list))

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

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

Solution (Python):

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

min, max = A[0], A[0]
for i in range(N-1):
    if A[i+1] < min:
        min = A[i+1]
    elif A[i+1] > max:
        max = A[i+1]

print(max-min)

Solution (Python):

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):

N = 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[n-1]-a[0])

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

c = 0
ans = []

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

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 = lmi()
    print(max(L) - min(L))


if __name__ == "__main__":
    main()

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

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

Solution (Python):
n = int(input())
mylist = list(map(int,input().split()))
mylist = sorted(mylist, key=abs)
x = mylist[0] - mylist[-1]
print(abs(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):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i+1, n):
        x = abs(a[i]-a[j])
        ans = max(ans, x)
print(ans)

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

print(abs(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())
List = list(map(int,input().split()))
ans = []
for i in range(n):
  for j in range(n):
    ans.append(abs(List[i]-List[j]))
print(max(ans))

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

ans = max(lis) - min(lis)

print(ans)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
m = -float('inf')
for i in range(n-1):
    for j in range(i+1, n):
        if abs(A[i]-A[j]) > m:
            m = abs(A[i]-A[j])

print(m)

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

print(max(items) - min(items))

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

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

Solution (Python):
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  
    A_arr = list(map(int,_in[1].split(' ')))  
    
    cnt = max(A_arr)-min(A_arr)
    
    print(cnt)

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
from operator import itemgetter
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
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)]
inf = 10**17
mod = 10**9 + 7


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

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

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

Solution (Python):

def inputlist(): return [int(k) for k in input().split()]

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

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

Solution (Python):


import numpy as np
n = int(input())
a = [int(x) for x in input().split()]
print(np.amax(abs(np.subtract.outer(a, 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()))
print(max(a) - min(a))

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

ans = 0
for a in A:
    for b in A:
        ans = max(ans, abs(a - b))
print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
largest = 0
for i in range(n):
    for j in range(i+1, n):
        if largest < abs(a[i] - a[j]):
            largest = abs(a[i] - a[j])

print(largest)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
sa=0
for i in range(0,n):
  for j in range(i,n):
    sasa=abs(a[i]-a[j])
    if sasa>sa:
      sa=sasa
print(sa)

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

t=0
for i in range(len(a)-1):
    for j in range(i+1, len(a)):
        if abs(a[i]-a[j])>t:
            t=abs(a[i]-a[j])
        
print(t)

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

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

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

ans = 0

for x in a:
    for y in a:
        if ans<abs(x-y):
            ans = abs(x-y)


print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ma = 0
for i in range(n-1):
    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()))

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

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

ans = 0
for i in range(len(a)-1):
    for j in range(i+1, len(a)):
        tmp = abs(a[i]-a[j])
        if ans < tmp:
            ans = tmp

print(ans)

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

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

    A = sorted(N)

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


resolve()

Solution (Python):
import sys
import os
import math
import string
import collections

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

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

print(max(ans))

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

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

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

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

Solution (Python):
c=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 = [int(X) for X in input().split()]
N
L = min(A)
B = max(A)
print(B-L)

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

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

maxi = 0
mini = float('inf')

for i in range(n):
  maxi = max(maxi, lst[i])
  mini = min(mini, lst[i])
  
print(maxi - mini)

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()]
A.sort()
dif = A[N-1]-A[0]
print(dif)

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

num_min = nums[0]
num_max = nums[0]
for item in nums:
  if item < num_min:
    num_min = item
  if item > num_max:
    num_max = item

print(num_max - num_min)

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

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