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: N=int(input())
a=list(map(int,input().split()))
min = min(a)
max = max(a)
b=max-min
if b%2!=0:
    b=b+1
b=b//2
print(b)

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

Python: N=int(input())

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


min=a[0]
i=0
for i in range(N):
    if a[i]<min:
        k=0
        k=a[i]
        a[i]=min
        min=k
    i+=1

max=a[0]
i=0
for i in range(N):
    if a[i]>max:
        k=0
        k=a[i]
        a[i]=max
        max=k
    i+=1
    
c=max-min
import math

print(int(math.ceil(c/2)))

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

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

for i in range(N):
    for j in range(N-1,0,-1):
        if xlist[j-1]>xlist[j]:
            xlist[j-1],xlist[j] = xlist[j],xlist[j-1]

if (xlist[N-1]-xlist[0])%2 == 0:
    T = (xlist[N-1]-xlist[0])//2

if (xlist[N-1]-xlist[0])%2 > 0 : 
    T = (xlist[N-1]-xlist[0])/2+0.5

print(int(T))

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

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: 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
N = int(input())
A = list(map(int, input().split()))
m = min(A)
M = max(A)
print(math.ceil((m + M) / 2) - m)

Python: N = int(input())
X = list((int(x) for x in input().split()))
X.sort()

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

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

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

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: x=int(input())
a=input().split()
j=0
while j<x :
    a[j]=int(a[j])
    j=j+1
i=0
while i<x :
    k=0
    while k<(x-1) :
        if a[k]>a[k+1] : 
            tmp=a[k]
            a[k]=a[k+1]
            a[k+1]=tmp
        k=k+1
    i=i+1
mx=int(a[x-1])
mn=int(a[0])
if (mx-mn)%2>0 : ans=(mx-mn)//2+1
else : ans=(mx-mn)/2
print(int(ans))

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

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

Python: n = int(input())
data = list(map(int, input().split()))
#print(max(data),min(data))
l = max(data) - min(data)
meet = -(-l //2)
print(meet)

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

Python: 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=input().split()

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

mina=min(a)
maxa=max(a)



print((maxa-mina+1)//2)

Python: a=int(input())
L=list(map(int,input().split()))
b=max(L)
c=min(L)
d=(b-c)//2
if (b-c)%2==0:
    print(d)
else:
    print(d+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: n=int(input())
l=[]
l=list(map(int,input().split()))
l.sort()
a=max(l)
b=min(l)
if (a-b)%2==0:
    print(int((a-b)/2))
else:
    print(int((a-b+1)/2))

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

print(int(c))

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

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

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

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

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

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


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

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

c=max(b)
d=min(b)

if (c-d)%2==0:
    print((c-d)//2)
else:
    print((c-d+1)//2)

Python: N = int(input())
a = list(map(int,input().split()))
m = min(a)
M = max(a)
k = M-m
if k%2 != 0:
    k+=1
k/=2
print(f'{k:1.0f}')

Python: n = int(input())

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


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

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

Python: import math
n = int(input())
a = list(map(int, input().split()))
x = max(a)
y = min(a)
print(math.ceil((x+y)/2)-y)

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: n=int(input())
x=list(map(int,input().split()))
s=max(x)-min(x)
if s%2==0:
    print(int(int(s/2)))
else:
    print(int((s+1)/2))

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

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

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

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

if x==1:
    print(0)
else:
    a=sorted(list)
    b=a[0]
    c=a[-1]
    if c-b==1:
        print(1)
    elif b==0:
        if c%2!=0:
            print(c//2+1)
        else:
            print(c//2)
    elif (c-b)%2!=0:
        print((c-b)//2+1)
    else:
        print((c-b)//2)

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

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

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

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

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

Python: n = int(input())
houses = list(map(int,input().split()))
houses.sort()
building = (houses[-1] - houses[0]) / 2 
if type(building) == float:
    building += 0.5
print(int(building))

Python: import math
n=int(input())
a=list(map(int, input().split()))
mn=min(a)
mx=max(a)
print(math.ceil((mn+mx)/2)-mn)

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

c=max(b)
d=min(b)

if (c-d)%2==0:
    print((c-d)//2)
else:
    print((c-d+1)//2)

Python: #(46)集会所
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())
X = list(map(int, input().split()))
Xmn, Xmx = min(X), max(X)
temp = []
res = Xmx-Xmn
for x in range(Xmn, Xmx+1):
	for n in range(N):
		temp.append(abs(X[n]-x))
	if max(temp)<res:
		res = max(temp)
	temp=[]

print(res)

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)