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

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

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

n_max = max(list)
n_min = min(list)

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

Solution (Python):
def main():
    N = int(input())
    A = []
    data = input().split()
    for i in range(N):
        A.append(int(data[i]))
    
    A.sort()
    print(A[N - 1] - A[0])
    
if __name__ == "__main__":
    main()

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

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

A_max = 0
A_min = 10**9

for i in A:
    if i < A_min:
        A_min = i
    if i > A_max:
        A_max = i

print(A_max - A_min)

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

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

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


m = 0
for i in range(n):
    for j in range(n):
        if abs(a[i] - a[j]) > m:
            m = abs(a[i] - a[j])

print(m)

Solution (Python):
N = int(input())
M = input().rstrip().split()

max=0
min=10e9

for i in range(N):
  k = int(M[i])
  if min > k:
    min = k
  if max < k:
    max = k

print(max-min)

Solution (Python):
N = int(input())
A=list(map(int,input().split()))
M=max(A,key=abs)
m=min(A,key=abs)
print(M-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()]
ma = max(a)
mi = min(a)
print(ma-mi)

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

A_sorted = sorted(A)
print(abs(A_sorted[0] - A_sorted[-1]))

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

max = max(A)
min = min(A)

print(max - min)

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

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

Solution (Python):
import numpy as np

N = int(input())
a = np.array([int(i) for i in input().split()])

b = np.abs(a.reshape(N,1) - a)
print(b.max())

Solution (Python):

N = int(input())
A = list(int(i) for i in input().split())

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

Solution (Python):





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

max_abs = -1
for i in range(N):
    for j in range(i+1, N):
        abs = a[i] - a[j]
        if abs <0:
            abs *= -1
        if max_abs < abs:
            max_abs = abs

print(max_abs)

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

Solution (Python):
import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import collections as cl
import functools as ft


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


n = LI()
a = sorted(LI())

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

Solution (Python):


N=int(input())

A=input().split(" ")
A = [int(i) for i in A]

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

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



max = int(l[0])
min = int(l[0])




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

print(max - min)

Solution (Python):
import numpy as np

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

a = np.array(A)

b = np.sort(a)

ans = abs((b[0]) - (b[-1]))

print(ans)

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

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

Solution (Python):
def run(n, a):
    max_a = max(a)
    min_a = min(a)
    return max_a - min_a


def read_line():
    n = int(input())
    a = list(map(int, input().split()))
    return (n, a)


def main():
    n, a = read_line()
    print(run(n, a))


if __name__ == '__main__':
    main()

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

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

Solution (Python):
Youso = int(input())
Suuti = list(map(int,input().split(" ")))


print(max(Suuti) - min(Suuti))

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

d = max(line) - min(line)

print(d)

Solution (Python):
a = int(input())
b = [int(i) for i in input().split()]
n = 0
for i in range(a):
    for j in range(i+1,a):
        k = abs(b[i] - b[j])
        if k > n:
            n = k
print(n)

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

max,min = a[0], a[0]
for i in a:
    if i > max:
        max = i
    if i < min:
        min = i
print(max - min)

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

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

nm = a[0]
nv = a[0]
for i in range(n):
    if a[i] > nv:
        nv = a[i]
        continue
    
    if a[i] < nm:
        nm = a[i]

print(nv-nm)

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

print(max(ass)-min(ass))

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=[int(i)for i in input().split()]
print(max(a)-min(a))

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

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

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

arr.sort()

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

Solution (Python):
import itertools

n = input()
ns = map(int, input().split())
print(max([ abs(x-y) for x,y in itertools.combinations(ns,2)]))

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

a=input().split()

b=[int(i) for i in a]
maxNum=0

for i in b:

	l=max([abs(x-i) for x in b])
	if(maxNum<l):
		maxNum=l

print(maxNum)

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

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

Solution (Python):
n = int(input())
arr = input().split(" ")
arr = [int(c) for c in arr]

max_ = max(arr)
min_ = min(arr)


print(max_ - min_)

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

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

Solution (Python):
n = int(input())
a = input()
a = a.split(' ')
a = list(map(int, a))
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(num) for num in 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):
def main():
	N = int(input())
	seq = list(map(int, input().split()))
	maks = 0
	for i in range(0, N):
		for j in range(i, N):
			maks = max(abs(seq[j] - seq[i]), maks)
	print(maks)
	return 0
main()

Solution (Python):


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

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

print(ans)

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

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

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

Solution (Python):
N = int(input())
A = list(map(lambda x:int(x),input().split(" ")))
MAX = max(A)
MIN = min(A)
print(MAX-MIN)

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

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

Solution (Python):
N = int(raw_input())
A = map(int, raw_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(i) for i in input().split()]   
a_max = max(a)
a_min = min(a)
print(a_max - a_min)

Solution (Python):

n = int(input())
nums = list(map(int,input().split()))
maxv = max(nums)
minv = min(nums)

print(maxv-minv)

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

max = max(l)
min = min(l)

print(abs(max-min))

Solution (Python):


if __name__ == '__main__':
    N = input()
    A = list(map(int, input().split()))

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

Solution (Python):
import math
import numpy as np



N = int(input())
line = input().split()
A = [int(a) for a in line]


min_ = 1e9
max_ = 1

for a in A:
    max_ = max(max_, a)
    min_ = min(min_, a)

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

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

print(MAX-MIN)

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

Solution (Python):
if __name__=="__main__":
  N = int(input())
  A = map(int, input().split())
  sortedA = sorted(A);
  print(sortedA[-1]-sortedA[0])

Solution (Python):

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

A_min = min(A)
A_max = max(A)

print(A_max - A_min)

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

max_a = max(a)
min_a = min(a)
print(max_a - min_a)

Solution (Python):
str_n = input()
n = int(str_n)
str_a = input()
arr_a = str_a.split(' ')
arr_ia = []
for item in arr_a:
    arr_ia.append(int(item))

arr_ia.sort()
print(int(arr_ia[-1]) - int(arr_ia[0]))

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

m = 0
for i in range(n):
	for j in range(i):
		b = abs(a[i]-a[j])
		if m<b:
			m = b
		
	
print(m)

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

Solution (Python):



def main():
    N = int(input().strip())
    A = [int(x) for x in input().strip().split()]
    print(abs(max(A)-min(A)))


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = list(map(int, input().strip().split()))
min_n = max_n = A[0]
for i in range(1, N):
	num = A[i]
	if min_n > num:
		min_n = num
	if max_n < num:
		max_n = num
result = max_n - min_n
print(result)

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

Solution (Python):
input()
a=input().split()
b=[]
m=0

for x in a:
  b.append(int(x))

for y in b:
  for z in b:
    c=abs(y-z)
    if m<c:
      m=c

print(m)

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

Solution (Python):

if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    print(abs(a[0]-a[n-1]))

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

print('{0:d}'.format(max(A) - min(A)))

Solution (Python):
import itertools as iter

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

print(max([abs(a-b) for a,b in iter.combinations(A, 2)]))

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

Solution (Python):
def abs(x):
    if x > 0:
        return x
    else:
    	return x * (-1)

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    a_sorted = sorted(a)
    print(abs(a_sorted[-1] - a_sorted[0]))

Solution (Python):
number = input()
b = input()
b = b.split()
c=[]

for i in b:
    c.append(int(i))

b_max=max(c)
b_min=min(c)

print(b_max - b_min)

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

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

Solution (Python):
N = int(input())
s = input().split()
s1 = [int(s) for s in s]

lst = sorted(s1)

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

Solution (Python):
N = int(input())
listN = input().split()
i = 0
while i < N:
    listN[i] = int(listN[i])
    i += 1
print(max(listN) - min(listN))

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

r = max(a) - min(a)
print(r)

Solution (Python):
N = int(input())
A = [int(t) for t in input().split()]
if len(A) != N: raise

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

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

maxv = -1

for i in range(n):
    for j in range(n-1):
        if i == j:
            continue
        if abs(a[i]-a[j]) > maxv:
            maxv = abs(a[i]-a[j])


print(maxv)

Solution (Python):

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

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

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

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

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

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

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

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

Solution (Python):
N=int(input())
list1=[int(i) for i in input().split()]
list2=[]
for i in range(N):
    for j in range(i):
        list2.append(abs(list1[i]-list1[j]))
print(max(list2))

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
mini=l[0]
maxi=l[0]
for i in l:
    if mini > i:
        mini =i
    if maxi < i:
        maxi=i
print(maxi-mini)

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


maximum = max(A)
minimum = min(A)

print(maximum - minimum)

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

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

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

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

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

result = 0
for Ai in range(len(As) - 1):
    for Aj in range(Ai + 1, len(As)):
        result = max(result, abs(As[Ai] - As[Aj]))

print(result)

Solution (Python):


import sys

def main(argv):
    line = sys.stdin.readline().rstrip("\n")

    while line:
        N = int(line)
        A = [int(a) for a in raw_input().rstrip("\n").split(" ")]
        sorted_A = sorted(A)
        distance = abs(sorted_A[-1] - sorted_A[0])
        print(distance)
        line = sys.stdin.readline().rstrip("\n")

if __name__ == "__main__":
    main(sys.argv)

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

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

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

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

Solution (Python):
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, = read_line(int)

xs = [int(x) for x in input().split()]

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

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):
def main():
    N = int(raw_input())
    list_A = map(int, raw_input().split(' '))

    sorted_A = sorted(list_A)
    print sorted_A[-1] - sorted_A[0]

main()

Solution (Python):
N = int(input())
LIS = input().split(" ")

lisnum = list(map(int, LIS))

Max = max(lisnum)
Min = min(lisnum)
print(Max - Min)

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

Solution (Python):

"""
Created on Sun Jul  1 20:09:43 2018
ABC102B
@author: maezawa
"""

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

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

print(d)

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

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

max_difference = 0

for i, n1 in enumerate(n_list):
  for j, n2 in enumerate(n_list):
    if i == j:
      continue
    diff = n2 - n1
    max_difference = max(max_difference, diff)

print(max_difference)

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

Solution (Python):

import numpy as np

n = int(raw_input())
a = np.array(map(int,raw_input().split()))

ma = np.max(a)
mi = np.min(a)

print ma-mi

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

Solution (Python):
import  math

n = int(input())
arr = input().split(" ")
numbers = []
for i in range(0,len(arr)):
    numbers.append(int(arr[i]))

maxdiff = 0

for i in range(0,len(numbers)):
    for j in range(i, len(numbers)):
        diff = abs(numbers[i]-numbers[j])
        if diff > maxdiff:
            maxdiff = diff
print(maxdiff)

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

max_a = max(a)
min_a = min(a)

print(max_a - min_a)

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

Solution (Python):


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

Amax = max(An)
Amin = min(An)

print(Amax - Amin)

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

maxA = A[len(A)-1]-A[0]

print(maxA)

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

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

Solution (Python):

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

max = A[0]
min = A[0]

for i in range(1,N):
    if max < A[i]:
        max = A[i]
    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()))

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

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

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

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

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

for i in range(n):
	a[i] = int(a[i])

x = max(a)
y = min(a)

print(x-y)

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

a_list.sort()

a_min=a_list[0]
a_max=a_list[-1]

print(a_max-a_min)

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

min_ = 10**9
max_ = 0

for a in A:
  min_ = min(min_, a)
  max_ = max(max_, a)

print(abs(max_ - min_))

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

max_a = max(A)
min_a = min(A)

ans = max_a - min_a
print(ans)

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

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

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

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

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

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

Solution (Python):
N = int(input())
A = input().strip().split(' ')
A = [int(x) for x in A]
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())
A = [int(i) for i in input().split()]

ans = 0
for j in range(len(A) - 1):
  for k in range(j + 1, len(A)):
    ans = max(ans, abs(A[j] - A[k]))
print(ans)

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

Solution (Python):
N = int(input())
A = [int(a) for a in input().split()]
ans = 0
for a in A:
  for i in range(len(A)):
    if ans < abs(a - A[i]):
      ans = abs(a - A[i])

print(ans)

Solution (Python):
N=int(input())
la=list(map(int,input().split()))
maxdiff=0
for i in range(N):
    for j in range(N):
        if(maxdiff<abs(la[i]-la[j])):
            maxdiff=abs(la[i]-la[j])
print(maxdiff)

Solution (Python):


MAX = 10 ** 9

if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split(" ")))
    max,min=(1,MAX)
    for i in range(n):
        if a[i] < min:
            min = a[i]
        if a[i] > max:
            max = a[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())
list = map(int, input().split())
list2 = sorted(list)
print(list2[n-1]-list2[0])

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
 
mn = 10 ** 9
mx = 0
 
for i in range(n):
  if a[i] < mn:
    mn = a[i]
    
  if a[i] > mx:
    mx = a[i]
  
print(mx - mn)

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

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

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

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

min_a = min(A)
max_a = max(A)

print(max_a - min_a)

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

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

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

Solution (Python):

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

re = max(A) - min(A)

print(re)

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

max_ = max(A)
min_ = min(A)

print(max_ - min_)

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

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

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

min_input = input_list[0]
max_input = input_list[0]

for i in input_list[1:num_args]:
  if i < min_input:
    min_input = i
  elif i > max_input:
  	max_input = i
    
print(abs(max_input-min_input))

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

Solution (Python):

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


A.sort()


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

Solution (Python):



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

ma = max(a)
mi = min(a)

print(ma - mi)

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

print(max(An) - min(An))

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

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

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

print(max)

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

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

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

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

A = tuple(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.sort()
print(a[n - 1] - a[0])

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

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

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

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

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

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

An.sort()

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

Solution (Python):
n = int(input())
a_tmp = input().split()
a = []
for i in range(n):
    a.append(int(a_tmp[i]))
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())
l=list(map(int,input().split()))
print(abs(max(l)-min(l)))

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

Solution (Python):


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

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

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

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

Solution (Python):
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 = [int(_) for _ in input().split()]
a.sort()
print(abs(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())
an = list(map(int, input().split()))
print(abs(max(an) - min(an)))

Solution (Python):


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

AN.sort()

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

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

Solution (Python):
_ = input()
nums = list(map(int, input().split(" ")))
n_min, n_max = min(nums), max(nums)
print(n_max - n_min)

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

ma = 0
for i in range(len(A)):
    for j in range(len(A)):
        if i != j:
            ma = max(ma, abs(A[i] - A[j]))
print(ma)

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

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

Solution (Python):
if __name__ == '__main__':
    length = int(input())
    array = list(map(int, input().split()))

    result = max(array) - min(array)

    print(result)

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

Solution (Python):


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

maxabs = 0

for i in range(n - 1):
    for j in range(i, n):
        v = abs(a[i] - a[j])
        if v > maxabs:
            maxabs = v

print(maxabs)

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

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

print(maxdiff)

Solution (Python):
n = map(int, input().split())
a = list(map(int,input().split()))
max = 0
min = a[0]

for i in a:
    if i > max:
        max = i
    if i < min:
        min = i

print(max-min)

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

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

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

lst = []
for i in range(n):
    for j in range(n):
        lst.append(abs(a[i]-a[j]))

lst.sort()
print(lst[-1])

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[j]-A[i]))
print(ans)

Solution (Python):
import numpy as np
n=int(input())
a=list(map(int, input().split(" ")))
print(np.max(a)-np.min(a))

Solution (Python):



N = int(input())

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

mini = 10**9
maxi = 1
for i in a:
    if i < mini:
        mini = i
    if maxi < i:
        maxi = i

print(maxi - mini)

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

A.sort()

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

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

arr = map(int,raw_input().split())


ans = 0
for i in range(n):
	for j in range(n):
		if i != j:
			ans = max(ans,abs(arr[i]-arr[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 = [int(i) for i in input().split()]

M = max(A)
m = min(A)
print(abs(M-m))

Solution (Python):




if __name__ == '__main__':
    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()))
ans = max(a) - min(a)
print(ans)

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

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

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

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

a_min = min(A)
a_max = max(A)

print(a_max - a_min)

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

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

max_n = max(a)
min_n = min(a)

if abs(max_n - min_n) > abs(min_n - max_n):
    print(abs(max_n - min_n))
else:
    print(abs(min_n - max_n))

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