Problem:
 Score : 300 points    Problem Statement Takahashi made N problems for competitive programming.
The problems are numbered 1 to N , and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K , as follows:   A problem with difficulty K or higher will be for ARCs .  A problem with difficulty lower than K will be for ABCs .   How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?      Problem Statement  2 \leq N \leq 10^5  N is an even number.  1 \leq d_i \leq 10^5  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  d_1  d_2  ...  d_N       Output Print the number of choices of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.        Sample Input 1 6
9 1 4 4 6 7      Sample Output 1 2  If we choose K=5 or 6 , Problem 1 , 5 , and 6 will be for ARCs, Problem 2 , 3 , and 4 will be for ABCs, and the objective is achieved.
Thus, the answer is 2 .       Sample Input 2 8
9 1 14 5 5 4 4 14      Sample Output 2 0  There may be no choice of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.       Sample Input 3 14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1      Sample Output 3 42685

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

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

d.sort()
num = int(len(d) / 2)
ans = d[num ] - d[num-1]


print(ans)

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
""" 
d = [9, 1, 4, 4, 6, 7]

N = 6

d = [9, 1, 4, 4, 6, 7]
 """


prob = []
cnt = 0
for i in d:
    prob.append([cnt, i])
    cnt += 1

""" print(prob)
print(sorted(prob, key=lambda x: x[1]))
 """
sorted_d = sorted(prob, key=lambda x: x[1])


cnt = 0

cnt += sorted_d[int(N/2)][1] - sorted_d[int(N/2-1)][1]

print(cnt)

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

d = sorted(d)

former = d[:eval(str(int(len(d) / 2)))]
latter = d[eval(str(int(len(d) / 2))):]

if former[-1] == latter[0]:
  print(0)
else:
  print(latter[0] - former[-1])

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

Solution (Python):
N = int(input())
dList = [int(x) for x in input().split()]
dList.sort()
print(dList[N//2] - dList[(N//2)-1])

Solution (Python):
N = int(int(input())/2)
l = list(map(int,input().split()))
l.sort()
print(l[N]-l[N-1])

Solution (Python):
N = int(input())
d = list(int(x) for x in input().split())

d.sort()

mid = int(N / 2)
answer = d[mid] - d[mid - 1]
print(answer)

Solution (Python):
N = int(input())
d = [int(i) for i in input().split()]
d = sorted(d)
low_num = d[int(N/2) - 1]
up_num = d[int(N/2)]
answer = 0
if(low_num == up_num):
    answer = 0
else:
    answer = up_num - low_num
print(answer)

Solution (Python):
def main():
  n = int(input())
  d = list(map(int,input().split()))
  ans = 0 
  d.sort()
  if d[n//2 -1] != d[n//2]:
    ans = d[n//2] -d[n//2 -1] 
  print(ans)
main()

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

d.sort()
minIndex = len(d) / 2 - 1
maxIndex = len(d) / 2

dmin = d[int(minIndex)]
dmax = d[int(maxIndex)]

print(dmax - dmin)

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

ARC_min = d_lis[int(N/2)]
ABC_max = d_lis[int(N/2)-1]

if ( ABC_max == ARC_min ):
	print(0)
else:
	print(ARC_min - ABC_max)

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

nums = list(map(int, input().split()))
nums.sort()
n/=2

if nums[int(n)] == nums[int(n-1)]:
    print(0)
else:
    print(int(nums[int(n)]-nums[int(n-1)]))

Solution (Python):
import statistics

n = int(input())
d = list(map(lambda x: int(x), input().split()))
m = statistics.median(d)
s = [i for i in d if i < m]
b = [i for i in d if i >= m]

if len(s) == len(b):
    ans = min(b) - max(s)
else:
    ans = 0
print(ans)

Solution (Python):
N = int(input())
d_list = sorted(list(map(int, input().split())))
print(d_list[N//2] - d_list[N//2-1])

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

d.sort()

print(d[len(d)//2] - d[len(d)//2-1])

Solution (Python):
n = int(input())
dl = list(sorted(map(int, input().split())))
d_left = dl[n // 2 - 1]
d_right = dl[n // 2]

print(d_right - d_left)

Solution (Python):
N = int(input())
ds = list(map(int, input().split()))
ds.sort()
n = N//2
print(ds[n]-ds[n-1])

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
lower, upper = N//2-1, N//2
D = [int(_) for _ in stdin.readline().rstrip().split()]
D.sort()
print(D[upper]-D[lower])

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
d.sort()
print(d[int(N/2)]-d[int(N/2)-1])

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

if N%2 == 0:
    m1 = d[N//2 - 1]
    m2 = d[N//2]
    print(d[N//2] - d[N//2 - 1])
else:
    print("0")

Solution (Python):


N = int(input())
data = list(map(int, input().split()))
data.sort()

half = int(N / 2)

print(data[half] - data[half-1])

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

h=int(n/2)
k_min=d[h-1]
k_max=d[h]
print(k_max-k_min)

Solution (Python):
n=int(input())
d=list(map(int,input().split()))
d.sort()
num=(int)(n/2)
if d[num]-d[num-1]>0:
  print(d[num]-d[num-1])
else:
  print(0)

Solution (Python):
n = int(input())
d = [int(x) for x in input().split()]
d.sort()
print(d[int(n / 2)] - d[int(n / 2) - 1])

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

arr.sort()

ans = arr[n//2] - arr[n//2-1]
print(ans)

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

print(d[n//2] - d[n//2-1])

Solution (Python):
N = int(input())
D = list(map(int, input().split()))
D.sort()
t = int(len(D)/2)
print(0 if D[t] - D[t-1] == 0 else D[t] - D[t-1])

Solution (Python):
import numpy as np

N = int(input())
data = list(map(int, input().split()))
data = sorted(data)

ans = data[N//2] - data[N//2 - 1]
print(ans)

Solution (Python):
N = int(input())
d = sorted(list(map(int, input().split())))
print(d[N//2] - d[N//2 - 1])

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

D_unique = list(set(D))
D.sort()

middle_idx = int(len(D)/2)
cnt = D[middle_idx]-D[middle_idx-1]
    
print(cnt)

Solution (Python):
n=int(input())
d=list(map(int,input().split()))
d.sort(key=int)
print(abs(d[int(n/2)]-d[int(n/2-1)]))

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

d.sort()

r = d[n//2]
l = d[n//2-1]

print(r-l)

Solution (Python):

N = int(input())
d = list(map(int, input().split()))
d.sort()
idx = N // 2
print(d[idx] - d[idx-1])

Solution (Python):
N = int(input())
D = list(map(int,input().split()))
D.sort()
print(D[N//2] - D[N//2-1])

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

n.sort()

print n[N / 2] - n[(N - 1) / 2]

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

d.sort()

print( d[(N//2)]-d[(N//2)-1])

Solution (Python):
n = int(input())
d = list(map(int,input().split())) 
D = sorted(d)
if D[n//2-1]==D[n//2]:
    print(0)
else:
    print(D[n//2]-D[n//2-1])

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

list3=sorted(list2)

Y=list3[int(N/2)]-list3[int(N/2-1)]
print(Y)

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

d = []


for i in range(N):
    d.append( int(d_[i]))

d.sort()

midNum = int(N/2)



print(d[midNum]-d[midNum-1])

Solution (Python):
a = int(input())
b = list(map(int, input().split()))
c = sorted(b)
d = c[(a//2)]-c[(a//2)-1]
print(d)

Solution (Python):
import random
import numpy as np

N = int(input())
d = [int(i) for i in input().split()]
dd = np.sort(d,kind='quicksort')

a = int(N / 2)
b = a - 1

K = dd[a] - dd[b]

print(K)

Solution (Python):

import sys


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

d.sort()

if d[N // 2] > d[N // 2 - 1]:
    print(d[N // 2] - d[N // 2 - 1])
else:
    print(0)

Solution (Python):

n = input()
arr = [int(x) for x in input().split()]
arr.sort()
l = len(arr)
ans = 0
if l%2 == 0:
	if arr[l//2] != arr[l//2-1]:
		ans = (arr[l//2] - arr[l//2 -1])
print(ans)

Solution (Python):
n = int(input())
difficulty = map(lambda x:int(x) ,input().strip().split())

probrems = []

for d in difficulty:
    probrems.append(d)


probrems.sort()

p_n = probrems[int(n/2)-1]
p_n_1 = probrems[int(n/2)]

print(p_n_1 - p_n)

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

B.sort()
cnt = 0
C = 0
result = 0
D = A // 2
for i in B:
    if cnt == D:
        result = i - C
        break
    else:
        C = i
        cnt += 1

print(result)

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

B.sort()
cnt = 0
C = 0
result = 0
for i in B:
    if cnt == A // 2:
        result = i - C
        break
    else:
        C = i
        cnt += 1

print(result)

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

p.sort()

ans = 0
mid = int(n/2)

if p[mid] != p[mid-1]:
    ans = p[mid] - p[mid-1]

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    nums = string_to_int(inputs[0])
    nums.sort()
    abc_last_i = len(nums) // 2 - 1
    arc_first_i = len(nums) // 2

    return nums[arc_first_i] - nums[abc_last_i]


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)

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


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

ls.sort()

K = ls[N//2] - ls[N//2 - 1]

print(int(K))

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

Solution (Python):
import statistics as stat

def calc(p):
  p.sort()
  l = len(p)
  return p[(l + 1) // 2] - p[(l - 1) // 2]

_ = input()
p = list(map(int, input().split()))

print(calc(p))

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

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

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


A.sort()
key = int(len(A)/2)
if A[key] == A[key-1]:
    print(0)
else:
    print(A[key] - A[key-1])

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
p.sort()
 
ans = p[n//2] - p[n//2-1]
print(ans)

Solution (Python):
N = int(input())
D = list(map(int, input().split()))
D.sort()
M = int(N/2)
print(D[M]-D[M-1])

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

d.sort()
print(d[n//2] - d[n//2-1])

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

Solution (Python):
N = int(input())
d = sorted(list(map(int, input().split())))
d.insert(0, 0)
print(d[N // 2 + 1] - d[N // 2])

Solution (Python):
N = int(input())
ds = [int(d) for d in input().split()]
ds = sorted(ds)
print(ds[N//2] - ds[N//2-1])

Solution (Python):


import sys
import copy

sys.setrecursionlimit(1000000)





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

d.sort()

print(d[N // 2] - d[N // 2 - 1])

Solution (Python):
n = int(input())
d = [int(i) for i in input().split()]
sorted_d = sorted(d)
center = sorted_d[int(n/2)]
if sorted_d[int(n/2-1)] == center:
    ans = 0
else:
    ans = center - sorted_d[int(n/2-1)]
print(ans)

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

d.sort()
s = N // 2
center = d[s]
center_ = d[s - 1]
if center == center_:
    print(0)
else:
    print(center - center_)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
 
c_idx = n // 2 - 1
l.sort()
print(l[c_idx + 1] - l[c_idx])

Solution (Python):
N = int(input())
D = [int(d) for d in input().split()]

D.sort()

mid = int(len(D)/2) -1
mid_next = D[mid+1] 
if D[mid] == D[mid + 1]:
    print(0)
else:
    for d in D[mid:len(D)]:
        if D[mid] != d:
            mid_next = d
            break
    print(mid_next - D[mid])

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

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

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

d.sort()
cnt=0
m=N//2
cnt=d[m]-d[m-1]
print(cnt)

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

d_list = sorted(d_list)

left = d_list[N//2 - 1]
right = d_list[N//2 ]

if right - left > 0:
	print(right-left)
else:
 	print(0)

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

Solution (Python):

def count_ABC_num(D, thr):
    return len([_ for _ in D if _ < thr])

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

D.sort()
cent_index = int(len(D)/2)

print(D[cent_index] - D[cent_index - 1])

Solution (Python):
n = int(input())
problems = list(map(int, input().split()))
problems.sort()
k = int(n/2)
print(problems[k] - problems[k-1])

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

d.sort()
print(d[int(N/2)] - d[int(N/2) - 1])

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

ret=Nlist[int(N/2)]-Nlist[int(N/2)-1]

print(ret)

Solution (Python):
n=int(input())
d=list(map(int,input().split()))
d.sort()
l=d[(n-1)//2]
s=d[(n-1)//2+1]
if (s-l==0 or n%2==1):
    print(0)
else:
    print(s-l)

Solution (Python):
S=int(input())
L=sorted(map(int,input().split()))
if L[S//2-1] != L[S//2]:
  print(L[S//2] - L[S//2-1])
else:
  print(0)

Solution (Python):
import numpy as np

N = int(input())

d = [int(x) for x in input().split()]
d = np.array(d)

d = np.sort(d)

print(d[N//2] - d[N//2 - 1])

Solution (Python):
import sys


scan = sys.stdin.readline


def main():
  n = int(scan().rstrip())
  d = [int(_) for _ in scan().rstrip().split()]
  
  if n % 2 == 1:
    print(0)
    sys.exit(0)
  
  d.sort()
  
  mid_index = len(d) // 2
  
  mid_small = d[mid_index - 1]
  mid_big = d[mid_index]
  
  print(mid_big - mid_small)


if __name__ == "__main__":
  main()

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
d.sort()
if(d[n//2] == d[n//2-1]):
    print(0)
elif(d[n//2] != d[n//2-1]):
    print(d[n//2] - d[n//2-1])

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

Solution (Python):

import sys
input = sys.stdin.readline

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


sd = sorted(d)
h = int(len(sd)/2)
result = sd[h] - sd[h-1]

print(result)

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

d.sort()
a=d[int(n/2)]-d[int(n/2-1)]
print(a)

Solution (Python):
n = int(input())
d = [int(x) for x in input().split()]
d.sort()
print(d[int(n/2)] - d[int(n/2)-1])

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

mi = d[int(len(d)/2-1)]
ma = d[int(len(d)/2)]

print(ma-mi)

Solution (Python):
N = int(input())
D = [int(d) for d in input().split()]
D.sort()
D_small = D[0:N//2]
D_big = D[N//2:N]
if D_small[-1]==D_big[0]:
  ans = 0
else:
  ans = D_big[0] - D_small[-1]
print(ans)

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
d.sort()
print(d[int(N/2)] - d[int(N/2-1)])

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

Solution (Python):
n = int(input())
d = list(map(int,input().split()))
d.sort()
if n%2 != 0:
    print("0")
else:
    if d[n//2-1] == d[n//2]:
        print("0")
    else:
        print(d[n//2]-d[n//2-1])

Solution (Python):
n=int(input())
d=list(map(int,input().split()))
sd=sorted(d)
print(sd[(n//2)]-sd[(n//2)-1])

Solution (Python):
n=int(input())
d_s=input().split()
d_i=[int(x) for x in d_s]
d=sorted(d_i)
k=d[int(n/2)]
t=d[int(n/2)-1]
print(k-t)

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

d_list.sort()

n = int(N / 2)
ans = d_list[n] - d_list[n-1]
print(ans)

Solution (Python):
n = int(input())
d = list(map(int,input().split()))
d.sort()
cs = [0]
ans = 0
l= 0
for i in range(d[-1]):
  temp = 0
  while(True):
    if i == d[l]:
      temp += 1
      l += 1
    else:
      break

  cs.append(cs[i]+temp)

ans = cs.count(n/2)
print(ans)

Solution (Python):
n = int(input())
d = list(map(int,input().split()))
d.sort()
cs = [0]
ans = 0
l= 0
for i in range(d[-1]):
  temp = 0
  while(True):
    if i == d[l]:
      temp += 1
      l += 1
    else:
      break

  cs.append(cs[i]+temp)

ans = cs.count(n/2)
print(ans)

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


if n%2 == 1:
    print(0)
else:
    d = sorted(d)
    print(d[int(n/2)]-d[int(n/2)-1])

Solution (Python):
n = int(input())
x = list(map(int, input().split()))
x.sort()
half = n // 2

print(x[half] - x[half-1])

Solution (Python):
n = int(input())
x = list(map(int, input().split()))
x.sort()
half = n // 2

print(x[half] - x[half-1])

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

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

if n%2 == 1:
    print(0)
else:
    print(d[len(d)//2]-d[(len(d)//2)-1])

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

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

ans = D[int(N / 2)] - D[int((N / 2) - 1)]
print(ans)

Solution (Python):
n = int(input())
dific_list = [int(i) for i in input().\
split(" ")]
dific_list.sort()
print(max(0, dific_list[int(n / 2)] \
- dific_list[int(n / 2) - 1]))

Solution (Python):
N = int(input())
d = sorted(list(map(int, input().split())))
print(d[N // 2] - d[N // 2 - 1])

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

d.sort()
if d[N//2] == d[N//2 - 1]:
    print(0)
else:
    print(d[N//2] - d[N//2 - 1])

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

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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])

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

d.sort()

if N % 2 == 0:
    ans = d[int(N/2)] - d[int(N/2) - 1]
else:
    ans = 0

print(ans)

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




y=sorted(d)
z=len(d)
w=int(z/2)

m=y[w-1]
n=y[w]

print(n-m)

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

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

r.sort()

print(r[n//2]-r[n//2-1])

Solution (Python):
L = int(input())
d_list = sorted(list(map(int, input().split())))
c = int(L/2)
print(d_list[c] - d_list[c-1])

Solution (Python):
input_line=int(input())
ARC = [int(i)for i in input().split()]
ARC.sort()
middle = input_line //2
s = ARC[middle]-ARC[middle-1]

print(s)

Solution (Python):
N=int(input())
d=list(map(int,input().split()))
d.sort()
a=int(N/2)
b=a-1
c=d[a]-d[b]
print(c)

Solution (Python):
n = int(input())
data = list(map(int, input().split()))
for i in range(n):
    data[i] = int(data[i])
data.sort()
print(data[n//2] - data[n//2 - 1])

Solution (Python):


def check(a,b,c):
	if((a<b)and(b<c))or((a>b)and(b>c)):
		return 1
	return 0

import sys
n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))


hoge.sort()
n=len(hoge)


m=n//2
if(hoge[m-1] == hoge[m]):
	print(0)
	sys.exit()

l=hoge[m]-hoge[m-1]





print(l)

Solution (Python):
n = int(input())
d = list(map(int, input().split(' ')))
d.sort()
print(d[int(n / 2)] - d[int(n / 2) - 1])

Solution (Python):
N = int(input())
A  = input().split()
for i in range(N):
  A[i] = int(A[i])
  
A.sort()
middle = int(N/2)
gap = A[middle] - A[middle - 1]
print(gap)

Solution (Python):
n = int(input())
p = sorted(list(map(int, input().split())))
mid = n // 2
print(p[mid] - p[mid-1])

Solution (Python):
input()
v = list(map(int, input().split()))
v.sort()
print(v[len(v) // 2] - v[len(v) // 2 - 1])

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

d=sorted(d)
print(d[N//2]-d[N//2-1])

Solution (Python):


N = int(input())
d = list(map(int, input().split()))
d.sort()

if d[N // 2] == d[N // 2 - 1]:
    print(0)
else:
    print(d[N // 2] - d[N // 2 - 1])

Solution (Python):
n=int(input())
d=list(map(int, input().split()))
s=sorted(d)
x=int(len(d)/2)
print(s[x]-s[x-1])

Solution (Python):
N = int(input())
D = [int(x) for x in input().split()]
D.sort()
mid = N//2
ans = D[mid] - D[mid-1]
print(ans)

Solution (Python):
n = int(input())
d = list(map(int,input().split()))
d.sort()
div = n//2
print(d[div]-d[div-1])

Solution (Python):
N = int(input())
D = [int(x) for x in input().split()]
D.sort()
mid = N//2
ans = D[mid] - D[mid-1]
print(ans)

Solution (Python):
N = int(input().split()[0])
d = list(map(int, input().split()))
d.sort()
div = int(N/2)
print(d[div]-d[div-1])

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

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

abc, arc = sorted(li_q)[:n // 2], sorted(li_q)[n // 2:]

print(arc[0] - abc[-1])

Solution (Python):
N = int(input())
D = [int(x) for x in input().split()]
D.sort()
mid = N//2
ans = D[mid] - D[mid-1]
print(ans)

Solution (Python):
N = int(input())
ds_ = list(map(int,input().split()))
ds = sorted(ds_)

def solve():
	low = ds[N//2 - 1]
	high = ds[N//2]
	
	return high - low
	
print(solve())

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

sorted_arr = sorted(arr)
mid = n // 2
ans = sorted_arr[mid] - sorted_arr[mid-1]
print(ans)

Solution (Python):
N=int(input())
x=int(N/2)
d=[int(x) for x in (input().split())]
d.sort()
print(d[x]-d[x-1])

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

def solve():
  sorted_D = sorted(D)
  return sorted_D[N//2] - sorted_D[N//2-1]

print(solve())

Solution (Python):
N=int(input())
D=list(map(int,input().split()))
D.sort()
n=N//2
print(D[n]-D[n-1])

Solution (Python):




n=int(input())
p=input().split()  
p=list(map(int,p))          
cnt=0

p=sorted(p)

if p[n//2]!=p[(n//2)-1]:
	cnt=p[n//2]-p[(n//2)-1]



print (cnt)

Solution (Python):
N=int(input())
D=[int(i) for i in input().split()]
D=sorted(D)
nanko=0
for i in range(D[N-1]+1):
    if(D[int(N/2)-1]<i and D[int(N/2)]>=i):
        nanko+=1
print(nanko)

Solution (Python):
print((lambda N,d:((N+1)%2)*(d[N//2]-d[N//2-1]))(int(input()),sorted(list(map(int,input().split())))))

Solution (Python):
n=int(input())//2
d=sorted(map(int,input().split()))
print(d[n]-d[n-1])

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

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

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

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

d.sort()
i = int(n/2)
print(d[i]-d[i-1])

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

Solution (Python):
def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

def is_odd(num):
    if num % 2 == 1:
        return True
    else:
        return False


n=int(input())


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

d=sorted(d)
LEN=int(len(d)/2)
if is_even(LEN):
    if d[LEN]==d[LEN-1]:
        print(0)

    else:
        print(d[LEN]-d[LEN-1])

elif is_odd(LEN):
    if d[LEN]==d[LEN-1]:
        print(0)

    else:
        print(d[LEN]-d[LEN-1])

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

d.sort()
print(d[N//2] - d[N//2-1])

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

n1 = N//2
print(d_list[n1] - d_list[n1 - 1])

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

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

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

d.sort()

m=n//2

e= d[m] - d[m-1]
print(e)

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

sd = sorted(d)
leng = len(sd)
lenha = int(leng/2)
if sd[lenha-1] == sd[lenha]:
    ans = 0
else :
    ans = sd[lenha] - sd[lenha-1]

print(ans)

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

d.sort()
left_boundary = int(N/2-1)
right_boundary = int(N/2)

if d[left_boundary] ==d[right_boundary]:
    print("0")
else:
    print(d[right_boundary] - d[left_boundary])

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

d = sorted(d)

a = d[int(n/2-1)]
b = d[int(n/2)]
if a==b:
    print(0)
else:
    print(b-a)

Solution (Python):
N = int(input())
d = list(map(int,input().split()))
d.sort()
print(d[N//2] - d[N//2-1])

Solution (Python):
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[int(n/2)]-s[int(n/2-1)])

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

li.sort()

a = int(len(li) / 2)

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

Solution (Python):

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

D.sort()

center = int(N/2)

print(D[center] - D[center-1])

Solution (Python):
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())

x=int(input())
t=list(intinput())
ans=0
t.sort()
print(t[x//2]-t[x//2-1])

Solution (Python):
def main():
    n = int(raw_input())

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

    sorted_diff = sorted(diff)

    print(sorted_diff[len(sorted_diff)/2] - sorted_diff[len(sorted_diff)/2 - 1])


if __name__ == "__main__":
    main()

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

mid_index = int(n/2-1)
d_list.sort()
mids = d_list[mid_index:mid_index+2]

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

Solution (Python):
lineNum = int(input())
diffData = list(map(int,input().split(" ")))
sortedDiffData = sorted(diffData)
diffDiff = sortedDiffData[len(sortedDiffData)//2] - sortedDiffData[(len(sortedDiffData)//2)-1]
print(diffDiff)

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

d.sort()



print(int(d[int(N/2)])-int(d[int(N/2)-1]))

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

Solution (Python):
def solve(string):
    n, *d = map(int, string.split())
    d = sorted(d)
    return str(d[n//2]-d[n//2-1])


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

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


d = sorted(d)

print(d[n // 2] - d[(n // 2) - 1])

Solution (Python):
n = int(input()) // 2
d = sorted(map(int, input().split()))
print(d[n] - d[n - 1])

Solution (Python):
n = int(input())
d = list(map(int,input().split()))
d.sort()
ans=d[n//2]-d[n//2-1]
print('{}'.format(ans))

Solution (Python):
def f(n, arr):
    if n % 2: return 0
    s = sorted(arr)
    return s[n // 2] - s[(n // 2) - 1]





n = int(input())
arr = [ int(i) for i in input().split(' ') ] 
print(f(n, arr))

Solution (Python):
N = int(input())
lst = [int(i) for i in input().split()]
lst.sort()
x = int(N/2)
print(lst[x]-lst[x-1])

Solution (Python):


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

d.sort()

a = d[int(n/2)-1]
b = d[int(n/2)]

print(b-a)

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

dd_sorted = sorted(dd)
print(dd_sorted[n//2] - dd_sorted[n//2 - 1])

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

d.sort()

a = int(N/2)
print(d[a] - d[a-1])

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
d.sort()
middle = int(n/2)

dBelowMiddle = d[middle - 1]
dAbobeMiddle = d[middle]

print(dAbobeMiddle - dBelowMiddle)

Solution (Python):
n=int(input())//2
d=[int(_) for _ in input().split()]
d.sort()
print(d[n]-d[n-1])

Solution (Python):
N = int(input())
d = list(map(int, input().split()))
d.sort()
n1 = int(N/2-1)
n2 = int(N/2)
ans = d[n2] - d[n1]
print(ans)

Solution (Python):
n = input()
test_dif = input().split(" ")

n = int(n)
test_dif = [int(n) for n in test_dif]
test_dif2 = sorted(test_dif)
a = test_dif2[int(n/2)-1]
b = test_dif2[int(n/2)]
ans = b - a
print(ans)

Solution (Python):
N = int(input())
l = sorted(map(int, input().split()))
j, K = -1, 0

for i in range(N):
    if j != l[i]:
        j = l[i]
        a, b = i, N-i
        
        if a == b:
            K += 1
            
            if i:
                K += l[i]-l[i-1]-1

print(K)

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

d.sort()
s1 = d[int(N/2) - 1]
s2 = d[int(N/2)]

print(s2-s1)

Solution (Python):
N = int(input())
D = list(map(int, input().split()))
D.sort()
print(D[N//2] - D[N//2 - 1])

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

dlist.sort()

M = int(N/2)

ans = dlist[M] - dlist[M-1]

print(ans)

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

d.sort()
h = N // 2
print(d[h] - d[h-1])

Solution (Python):
n = int(input())
d = [int(i) for i in input().split()]
d.sort()
diff = d[int(n/2)] - d[int(n/2 - 1)]
print(diff)

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

if l[n//2]==l[n//2-1]:
  print(0)
  exit()
print(l[n//2]-l[n//2-1])

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

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

sort_d = sorted(d)
print(sort_d[len(sort_d) // 2] - sort_d[(len(sort_d) // 2) - 1])

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

num.sort()

ans = num[len(num) // 2] - num[len(num) // 2 - 1]

print(ans)

Solution (Python):
N = int(input())
d = list((map(int, input().split())))
d.sort()
print(d[len(d) // 2] - d[len(d) // 2 - 1])

Solution (Python):
N, d = int(input()), sorted([int(i) for i in input().split()])
print(d[N//2] - d[N//2-1])

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

d.sort()
harf_pre = d[n // 2 - 1]
harf_post = d[n // 2]

print(harf_post - harf_pre)

Solution (Python):
n = int(input())
ls = []
get_values = input()
ls = get_values.split() 
for i in range(len(ls)):
    ls[i] = int(ls[i]) 
ls.sort() 
print(ls[n//2]-ls[n//2-1])

Solution (Python):
_, d = int(input()), sorted([int(i) for i in input().split()])
print(d[len(d)//2] - d[len(d)//2-1])

Solution (Python):
N = int(input())
d = [int(i) for i in input().split()]
d.sort()
hf = d[len(d)//2-1]
hb = d[len(d)//2]
print(hb - hf)

Solution (Python):
def main():
    n = input()
    d_list = list(map(int, input().split()))
    d_list.sort()
    arc = d_list[int(len(d_list) / 2)]
    abc = d_list[int(len(d_list) / 2) - 1]
    print(arc - abc)


if __name__ == '__main__':
    main()

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

li = list(map(int, input().split()))
li.sort()

print(li[n//2] - li[n//2 -1])

Solution (Python):
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

n = ni()
a = na()
a.sort()
print(a[n//2] - a[n//2 - 1])

Solution (Python):
n=int(input())
d=list(map(int,input().split()))
d.sort()
div=int(n/2)
if d[div-1]==d[div]:
  print(0)
else:
  print(d[div]-d[div-1])

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

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

b.sort()

c = len(b) // 2

print(b[c] - b[c-1])