Problem:


Score : 200 points

Problem Statement

It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.

There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.

Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.  

Constraints

1 ≤ N ≤ 100

0 ≤ a_i ≤ 1000

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

Print the minimum distance to be traveled.  

Sample Input 1

4
2 3 7 9

Sample Output 1

7

The travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2.

It is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.  

Sample Input 2

8
3 1 4 1 5 9 2 6

Sample Output 2

8

There may be more than one house at a position.  



Sample input:
4
2 3 7 9


Sample output:
7

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

data = input().split()
data = data[:N]

print(int(max(data)) - int(min(data)))

Submission status: Accepted

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

Submission status: Accepted

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

max=-10
min=10000
for i in a:
    if i>max:
        max=i
    if i<min:
        min=i
print(max-min)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
N = int(input())
a = list(reversed(sorted(list(set(list(map(int, input().split())))))))
ans = 0
for tmp in range(len(a)-1):
    ans += a[tmp] - a[tmp+1]
print(ans)

Submission status: Accepted

Solution code:
n = raw_input()
a = map(int, raw_input().split())

print max(a)-min(a)

Submission status: Accepted

Solution code:
N=int(input())

a=map(int,input().split())
b=sorted(a)

print(str(b[N-1]-b[0]))

Submission status: Accepted

Solution code:
N = int(input())
houses = [int(i) for i in input().split()]
max_pos = max(houses)
min_pos = min(houses)
print(max_pos-min_pos)

Submission status: Accepted

Solution code:
import sys

def main():
    n = int(sys.stdin.readline())

    max_a = -1
    min_a = 1001

    line = sys.stdin.readline()
    for ch in line.split():
        a = int(ch)
        if a > max_a:
            max_a = a
        if a < min_a:
            min_a = a

    print(max_a - min_a)
    return 0

if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
N = int(input())
min = 1001
max = 0

addresses = inputs = list(map(int, input().split(" ")))
for address in addresses:
    if address < min:
        min = address
    if address > max:
        max = address

print(max - min)

Submission status: Accepted

Solution code:
n = int(input())
a_list = input().split()
a_list_num = [int(a) for a in a_list]

print(max(a_list_num)-min(a_list_num))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
M, m = max(a), min(a)

print(M - m)

Submission status: Accepted

Solution code:
n = int(input())
points = [int(x) for x in input().split()]
points.sort()
print(points[-1] - points[0])

Submission status: Accepted

Solution code:
N = int(raw_input())
A = map(int, raw_input().split())

print max(A) - min(A)

Submission status: Accepted

Solution code:
N = int(raw_input())
a = map(int, raw_input().split())
print(max(a) - min(a))

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

a = sorted(a,reverse=True)

result = 0

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

print(result)

Submission status: Accepted

Solution code:
# coding: utf-8

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

print max(a) - min(a)

Submission status: Accepted

Solution code:
#! /usr/bin/env python3

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a.sort()

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

Submission status: Accepted

Solution code:
N=int(input())
A=input().split()
print(int(max(A))-int(min(A)))

Submission status: Accepted

Solution code:

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

b()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python

n = input()
a = [i for i in input().split()]
a = sorted(a, reverse = True)
print(int(a[0]) - int(a[-1]))

Submission status: Accepted

Solution code:
#coding:utf-8

if __name__ == "__main__":
    N = int(input())
    num_list = list(map(int, input().split(" ")))

    print(max(num_list) - min(num_list))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())

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

    a.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#! -*- coding:utf-8 -*-
n = int(input())
arr = list(map(int,input().split()))
arr.sort()
print(arr[-1]-arr[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())
ary = [int(e) for e in input().split()]

max_a = max(ary)
min_a = min(ary)

print(max_a - min_a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(raw_input())
a=map(int,raw_input().split(' '))

print max(a)-min(a)

Submission status: Accepted

Solution code:
N = int(raw_input())
a = map(int, raw_input().split())
print(max(a)-min(a))

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
n = raw_input()
a = map(int, raw_input().split())
left = min(a)
right = max(a)
print right - left

Submission status: Accepted

Solution code:
N = int(input())
mn = 1e9
mx = -1
ss = input().split()
for i in range(N) :
	t = int(ss[i])
	mn = min(mn, t)
	mx = max(mx, t)

print(mx-mn)

Submission status: Accepted

Solution code:
import sys
n = map(int, sys.stdin.readline().split())
a = map(int, sys.stdin.readline().split())
print max(a) - min(a)

Submission status: Accepted

Solution code:
n = int(input())
a = []
i = input().split()
for x in range(n):
 a.append(int(i[x]))
a.sort()
print(a[-1]-a[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
a = [int(n) for n in input().split()]
print(max(a) - min(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import array, bisect, collections, copy, heapq, itertools, math, random, re, string, sys, time
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7


def II(): return int(input())
def ILI(): return list(map(int, input().split()))
def IAI(LINE): return [ILI() for __ in range(LINE)]
def IDI(): return {key: value for key, value in ILI()}


def read():
    N = II()
    a = ILI()
    return (N, a)


def solve(N, a):
    num_min = min(a)
    num_max = max(a)
    ans = num_max - num_min
    return ans


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
inpt = map(int, raw_input().split())
inpt.sort()

print inpt[n-1] - inpt[0]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

Solution code:
n = int(raw_input())

a = [int(_) for _ in raw_input().split()]
print max(a) - min(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
A = map(int, raw_input().split())
print max(A) - min(A)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

input()
a = sorted([int(x) for x in input().split()])
print(max(a) - min(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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

Submission status: Runtime Error

Solution code:
use proconio::*;
use std::cmp::*;
use std::vec::Vec;

fn main() {
    input! {
        n: usize,
        mut A: [i32; n],
    }
    A.sort();
    let res = A[n - 1] - A[0];
    println!("{}", res);
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
A = list(input().split())
print(max(A)-min(A))

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
print(max(a)-min(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(input()) for _ in range(n)]
print(max(a)-min(a))

Submission status: Runtime Error

Solution code:
_,*aa = map(int, open(1).read().split())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(actual(N, A))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# ABC064_B
N = int(input())
A = [list(map(int,input().split()))]
print(max(A)-min(A))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

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

A = sorted(a)
print(A[-1] - A[0])

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

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

A = sorted(a)
print(A[-1] - A[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(input()) for _ in range(N)]

a.sort()

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

Submission status: Runtime Error

Solution code:

N = int(input())

list = []
for i in range(N) :
    a = input()
    list.append(a)

list.sort()

print(int(list[N-1])-int(list[0]))

Submission status: Runtime Error

Solution code:

N = int(input()) 

list = []
for i in range(N) :
    a = input()
    list.append(a)

list.sort()

print(int(list[N-1])-int(list[0]))

Submission status: Runtime Error

Solution code:

N = int(input()) 

list = []
for i in range(N) :
    a = input()
    list.append(a)

print(int(list[N-1])-int(list[0]))

Submission status: Runtime Error

Solution code:

N = int(input()) 

list = []
for i in range(N) :
    a = input()
    list.append(a)

print(int(list[N])-int(list[0]))

Submission status: Runtime Error

Solution code:

N = int(input()) #家の数

list = []
for i in N :
    a = input()
    list.append(a)

print(int(list[N])-int(list[0]))

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(input()) for _ in range(N)]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

N=int(input())
#A=np.array([map(int,input().split())])
A = np.array([int(i) for i in input().split()])
max_A=np.max(A)
min_A=np.min(A)
print(max_A-min_A)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = [map(int, input().split())]
ans = max(a) - min(a)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n = ii()
A = set(sorted(iil()))
print(set[-1]-set[0])

Submission status: Runtime Error

Solution code:
x,y,z=map(int,input().split())
x-=2
ans=x//(y+z)

rem=x%(y+z)
if rem>=y:
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
aa=map(int,input().split())
aa.sort()
d=0
for i in range(1,len(aa)):
  d+=abs(aa[i]-aa[i-1])
print(d)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input()
l = [*map(int, input().split())]
print(max(l)-min(l))

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 30, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,*A = map(int, readline().split())
A.sort()
print(A[-1]-A[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
listaMinimo=[]
maximo=0
while N>0:
    ai=int(input())
    if ai > maximo:
        maximo=ai
    listaMinimo.append(ai)
    N-=1
minimo = min(listaMinimo)
print(maximo-minimo)

Submission status: Runtime Error

Solution code:
n = int(input())

l = sorted(list({int(i) for i in input().split()}))

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

Submission status: Runtime Error

Solution code:
s = list(map(int,intput().split()))
s.sorted()

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

Submission status: Runtime Error

Solution code:
s = list(map(int,intput().split()))
s.sort()

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

Submission status: Runtime Error

Solution code:
s = list(map(int,intput().split()))
s.sorted

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

Submission status: Runtime Error

Solution code:
s = list(map(int,intput().split()))
s.sort

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
arr = map(int,input().split(" "))
mx=arr(0)
mn=arr(0)
for a in srr:
  if(mx<a):
    mx=a
  else if(mn>a):
      mn=a

      print(mx-mn)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
print(sorted(set(a))[-2])

Submission status: Runtime Error

Solution code:
# B - Traveling AtCoDeer Problem
N = int(input())
a = list(map(int, input().split()))
A = set(a)
A1 = sorted(A)
count = 0
for i in range(N-1) :
    count += A1[i+1]-A1[i]

print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
alist = [int(input()) for _ in range(n)]
dis = max(alist) - min(alist)
print(dis)

Submission status: Runtime Error

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

print(max(A) - max(B))

Submission status: Runtime Error

Solution code:
_ = input()
a = list(map(int, input().strip().strip(' ')))
print(max(a)-min(a))

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(input()) for _ in range(n)]
print(a[0] if len(a)==1 else max(a)-min(a))

Submission status: Runtime Error

Solution code:
input()
x=map(int,input().split())
print(x[-1]-x[0])

Submission status: Runtime Error

Solution code:

x=map(int,input().split())
print(x[-1]-x[0])

Submission status: Runtime Error

Solution code:
n=input()
x=input().split()
print(x[-1]-x[0])

Submission status: Runtime Error

Solution code:
n=input()
x=input().split()
print(x.[-1]-x.[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
  max=h[0]
  min=h[0]
for i in a:
  h[i]=int(input())
  
  if max<h[i] :
    max=h[i]
  if min>h[i] :
    min=h[i]
answer=max-min
print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(max(hoge)-min()hoge)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-


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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(input()) for i in range(N)]
print(max(A) - min(A))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
an= sorted(set([input() for n in range(N)]))
print(an[-1]-an[0])

Submission status: Runtime Error

Solution code:
N = int(input())
a = sorted([int(input()) for _ in range(N)])
print(a[-1]-a[0N = int(input())
a = map(int, input().split())
a = sorted(a)
print(a[-1]-a[0])

Submission status: Runtime Error

Solution code:
N = int(input())
a = sorted([int(input()) for _ in range(N)])
print(a[-1]-a[0])

Submission status: Runtime Error

Solution code:
n = int(input())
a = sorted([int(input()) for _ in range(N)])
print(a[-1]-a[0])

Submission status: Runtime Error

Solution code:
N = int(input())
for i in range(N):
    a = list(map(int,input().split())) 
A = set(a)
B = sorted(A)
C = []
for i in range(len(A)):
    C.append(B[i+1]-B[i])
print(sum(C))

Submission status: Runtime Error

Solution code:
N = int(input())
a = map(int,input().split())
L = []
M = []
for i in range(N):
  L.append(a[i])
L.sort()
for i in range(N):
  M.append(L[i+1]-L[i])
print(sum(M))

Submission status: Runtime Error

Solution code:
n = int(input())
home_list = input().split()
home_list.sort()
print(home_list[n-1] - home_list[0])

Submission status: Runtime Error

Solution code:
n = int(input())
home_list = input().split()
home_list.sort()
print(hpme_list[n-1] - home_list[0])

Submission status: Runtime Error

Solution code:
input()+(lambda a:print(max(a)-min(a)))(list(map(int,input().split())))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
loops = int(input())
LIST = [int(input()) for _ in range(loops)]

print(max(LIST) - min(LIST))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

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

Submission status: Runtime Error

Solution code:
N=int(input())
a_n=[int(x) for i in input().split()]

print(max(a_n)-min(a_n))

Submission status: Runtime Error

Solution code:
nums = [0]
n = int(input())
nums *= n
nums = list(map(int,input().split()))
max = 0
min = 1000
for i in range(n):
    if nums[i]<min:
        min = nums[i]
    if max<list[i]:
        max = nums[i]
print(max-min)

Submission status: Runtime Error

Solution code:
input()
coords = input.split()
print(max(coords) - min(coords))

Submission status: Runtime Error

Solution code:
l = map(int, raw_input().split())

r = l[0]*100
g = l[1]*10
b = l[2]

if(r + g + b) % 4 == 0:
  print "YES"
else:
  print "NO"

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

x = int(input())
#x = 8

y = input()
#y = ["3","1","4","1","5","9","2","6"]

for i in range(x):
    y[i] = int(y[i])

Max = max(y)
Min = min(y)

ans = Max - Min

print(ans)

Submission status: Runtime Error

Solution code:
N=input()
a=raw_input().split(' ')
print(max(a)-min(a))

Submission status: Runtime Error

Solution code:
a=raw_input().split(' ')
print(max(a)-min(a))

Submission status: Runtime Error

Solution code:
n = input()
houses = raw_input().split()
houses = sorted(list(set(houses)))

print houses[-1] - houses[0]

Submission status: Runtime Error

Solution code:
raw = int(raw_input().split(""))
tmp = 1
for i in range(len(raw) - 1):
  div = abs(raw[i] - raw[i-1])
  if div >= tmp:
    tmp = div
print tmp

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(num) for num in input().split()]
print(str(max(a)-min(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys

N = input()
an = input()
s = sorted(set(int(an.split())))
print(sum(s))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys

N = input()
an = input()
s = sorted(set(an.split()))
print(sum(s))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys

N = input()
an = input()

s = set(sorted(an.split()))
print(sum(s))

Submission status: Runtime Error

Solution code:
N = int(input())

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = [input() for i in range(N)]

output = int(max(a)) - int(min(a))
print(output)

Submission status: Runtime Error

Solution code:
input(); print((lambda xs: max(xs) - min(xs))[int(x) for x in input().split()])

Submission status: Runtime Error

Solution code:
r = input().split()
max_i= max(r)
min_i= min(r)
print(max_i - min_i)

Submission status: Runtime Error

Solution code:
def main():

    s = raw_input()
    s = s.split("\n")

    a = []
    for i in range( int(s[0]) ):
        a[i] = s[1].split()[i]

    for k in range( int(s[0]) ):
        for i in range( int(s[0]) ):
            if a[i] >= a[i+k]:
                b = a[i+k]
                a[i+k] = a[i]
                a[i] = b

    print( a[ int(s[0]) ] - a[0] )

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N=int(input())
a=[int(i) for i in input(). split ()]
mi=a[0]
ma=a[0]
while i<N:
    if a[i]>ma:
        ma=a[i]
    if a[i]<mi:
        mi=a[i]
    i+=1
print (ma-mi)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

a = [ int(input()) for i in range(int(input())) ]

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

Submission status: Runtime Error

Solution code:
N=int(input())
a=[int(i) for i in input(). split ()]
mi=a[i]
ma=a[i]
while i<N:
    if a[i]>ma:
        ma=a[i]
    if a[i]<mi:
        mi=a[i]
    i+=1
print (ma-mi)

Submission status: Runtime Error

Solution code:
N=raw_input()
a=raw_input().split()

import numpy as np
ans=np.abs(np.max(a)-np.min(a))
print(ans)

Submission status: Runtime Error

Solution code:
houseTime = int(input())
place = input().split() 
place = int(i) for i in place
place = sorted(place)
print(place[houseTime - 1] - place[0])