Go: package main

import "fmt"

func main() {
	var n, x int
	fmt.Scanln(&n)
	min, max := 2000, 0
	for ; n > 0; n-- {
		fmt.Scan(&x)
		if x < min {
			min = x
		}
		if x > max {
			max = x
		}
	}
	fmt.Println((max - min + 1) / 2)
}

Python: a = int(input())
b = list(map(int,input().split()))
c = abs(max(b) - min(b))
if c % 2:
  c = c + 1
  print(c // 2)
else:
  print(c // 2)

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

a = max(x)-min(x)

if a%2==0:
    print(a//2)
else:
    a += 1
    print(a//2)

Python: lst=[]
N=int(input())
lst=[int(x) for x in input().split()]
a=max(lst)
b=min(lst)
print(a-((a+b)//2))

Python: n = int(input())
a = list(map(int,input().split()))
if (max(a)-min(a)) % 2 == 0:
    print((max(a)-min(a))//2)
else:
    print((max(a)-min(a))//2+1)

Python: import math
N = int(input())
x = [int(x) for x in input().split()]
print(math.ceil((max(x) - min(x)) / 2))

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

sub = max(X) - min(X)

if sub % 2 == 0 :
    print(sub // 2)
else :
    print(sub // 2 + 1)

Python: input()
x = input() # x = "4 0 2"
list_a = x.split() # list_moji = ["4", "0", "2"]
list_num = []
for i in list_a:
    list_num.append(int(i))
answer = max(list_num) - (min(list_num) + max(list_num))//2
print(answer)

Python: N = int(input())
x = list(map(int, input().split()))
max = max(x)
min = min(x)
if (max - min) % 2 == 0:
    print((max - min) // 2)
else:
    print(((max - min) + 1) // 2)

Python: a=int(input())
lst=list(map(int,input().split()))
b=max(lst)
c=min(lst)
d=(b-c)//2
if (b-c)%2==0:
    print(d)
else:
    print(d+1)

Python: N=int(input())
a = list(map(int,input().split()))
a.sort()
A=(max(a)-min(a)+1)//2
print(A)

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

s = max(x) - min(x)
if s == 1:
   print("1")
else:
   if s % 2 == 0:
      print(int(s / 2))
   else:
      print(int(s / 2) + 1)

Python: n=int(input())
x=list(map(int,input().split()))
mi=(max(x)+min(x))//2
print(max(x)-mi)

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


if (max(i)-min(i))%2==0:
    print(int((max(i)-min(i))/2))
if (max(i)-min(i))%2==1:
    print(int((max(i)-min(i)+1)/2))

Python: n=int(input())
l=list(map(int,input().split()))
a=max(l)
b=min(l)
c=(a+b+1)//2
print(abs(b-c))

Python: N = int(input())
lst1 = list(map(int,input().split()))
y = min(lst1)
z = max(lst1)
if (z-y)%2==0:
    print((z-y)//2)
else:
    print((z-y+1)//2)

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

print(max(a)-(max(a)+min(a))//2)

Python: N=int(input())
x=list(map(int,input().split()))
min_x=min(x)
max_x=max(x)
m1=(min_x+max_x)//2
m2=(min_x+max_x+1)//2
print(min([max(max_x-m1,m1-min_x),max(max_x-m2,m2-min_x)]))

Python: N=int(input())

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

a= max(x) - min(x) +1

print(a//2)

Python: # coding: utf-8
# Your code here!

n = int(input())
a = list(map(int,input().split()))
print((max(a)-min(a)+1)//2)

Python: import math
h=int(input())
p=list(map(int,input().split()))
print(math.ceil((max(p)-min(p))/2))

Python: n=int(input())
x=list(map(int,input().split()))
s=max(x)-min(x)
if s%2==0:
    print(int(s/2))
else:
    print(int((s+1)/2))

Python: N = int(input())
a = list(map(int,input().split()))
if (max(a)-min(a))%2 == 0:
    print((max(a)-min(a))//2)
else:
    print(((max(a)-min(a))//2)+1)

Python: # coding: utf-8
# Your code here!
N=int(input())
x=list(map(int,input().split()))

if (max(x)-min(x))%2==0:
    print((max(x)-min(x))//2)
else:
    print((max(x)-min(x))//2+1)

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


if (A[-1]-A[0])%2==1:
    print((A[-1]-A[0]+1)//2)
else:
    print((A[-1]-A[0])//2)

Python: # coding: utf-8
# Your code here!

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

s = max(l) - min(l)
if s == 1:
   print("1")
else:
   if s % 2 == 0:
      print(int(s / 2))
   else:
      print(int(s / 2) + 1)

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

l=max(lst)-min(lst)
if l==1:
    print(1)
elif l%2==0:
    print(int(l/2))
else:
    print(int((l+1)/2))

Python: n=int(input())
l=list(map(int,input().split()))
    
x=max(l)-min(l)
    
if x==1:
    print("1")
elif x%2==0:
    print(x//2)
else:
    print(x//2+1)

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

t=max(x)-min(x)
if t%2==0:
    y=int(t/2)
else:
    y=int((t+1)/2)
print(y)

Python: import math

N=int(input())

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

a=((min(i)+max(i))/2)
a=math.ceil(a)

print(a-min(i))

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

minX = 9999
maxX = -1

for i in range(N):
    minX = min(minX, x[i])
    maxX = max(maxX, x[i])
    
print((maxX-minX+1)//2)

Python: import math
A = int(input())
B = list(map(int,input().split()))
m = min(B)
M = max(B)
print(math.ceil((m + M) / 2) - m)

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

memory = max([abs(int(p)-a[0]) for p in a])
for i in range(a[0]+1,a[n-1]+1):
    memory1 = max([abs(int(t)-i) for t in a])
    memory = min(memory,memory1)
print(memory)

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

lst.sort()

d = (lst[n-1]-lst[0])+1
print(d//2)

Python: N=int(input())
n=list(map(int,input().split()))
if N >= 2:
    a=sorted(n)
    if (a[N-1]-a[0])%2 == 0:
        print((a[N-1]-a[0])//2)
    else:
        print((a[N-1]-a[0]+1)//2)
elif N == 1:
    print(0)

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

m = max(houses)
n = min(houses)

print((m-n+1)//2)

Python: N = int(input())
x_array = sorted([int(x) for x in input().split()])
dif = int((x_array[-1] + x_array[0])/2)
print(x_array[-1]-dif)

Python: N=int(input())
x=list(map(int,input().split()))
s=max(x)-min(x)
if s%2==0:
    print(int(s/2))
else:
    print(int((s+1)/2))

Python: #0407
N = int(input())
x = list(map(int,input().split()))
x.sort()
a = int(x[0])
b = int(x[N-1])
if a%2 == 0 and b%2 == 0:
    print((b - a)//2)
else:
    print((b - a + 1)//2)

Python: import math
N=int(input())
line=input()
a=[]
t = line.split(" ")
for i in range(0,N):
    a.append(int(t[i]))

A = []
for n in a:
    A.append(n-min(a))
print(math.ceil((max(A)+min(A))/2))

Python: import math
n=int(input())
a=list(map(int,input().split()))
A=max(a)
B=min(a)
C=(math.ceil((A+B)/2))
if abs(A-C) > abs(B-C):
    print(abs(A-C))
elif abs(A-C) < abs(B-C):
    print(abs(B-C))
else:
    print(abs(A-C))

Python: N=int(input())
a=list(map(int,input().split()))
print((max(a)-min(a)+1)//2)

Python: n=int(input())
lis=list(map(int,input().split()))
a=max(lis)
b=min(lis)
x=a-b
y=-(-x//2)
print(y)

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

b = (max(a) - min(a)) / 2
c =(math.ceil(b))
print(c)

Python: 
if __name__ == '__main__':

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

	l = min(B)
	r = max(B)

	ans = r - (l + r ) // 2 
	print(ans)

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

S = max(A)-min(A)

if S%2 == 0:
    print(S//2)
else:
    print(S//2+1)

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

distance = max(arr) - min(arr)

if distance % 2 == 0:
    print(distance // 2)
else:
    print(distance // 2 + 1)

Python: import math
N = int(input())
A = list(map(int, input().split()))
m = min(A)
M = max(A)
print(math.ceil((m + M) / 2) - m)

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

Python: n=int(input())
x=list(map(int,input().split()))
s=max(x)-min(x)
if s%2==0:
    print(int(s/2))
else:
    print(int((s+1)/2))

Python: N=int(input())
x=[]
x=list(map(int,input().split()))
list.sort(x)
distance=(x[N-1]-x[0])//2
if N==1:print(0)
else:
    if distance==0:time=1
    elif (x[N-1]-x[0])%2==0:time=distance
    else:time=distance+1
    print(time)

Python: import math
N = int(input())
A = list(map(int, input().split()))
m = min(A)
M = max(A)
print(math.ceil((m + M) / 2) - m)