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

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007


def A():
    s = S()
    d = defaultdict(int)
    for i in s:
        d[i] += 1
    for i in d.keys():
        if d[i] != 2:
            print("No")
            quit()
    print("Yes")
    return


def B():
    n = I()
    p = LI()
    ans = 0
    for i in range(1,n-1):
        k = p[i-1:i+2]
        k.sort()
        if k[1] == p[i]:
            ans += 1
    print(ans)
    return


def C():
    n = I()
    d = LI()
    d.sort()
    print(d[n//2]-d[n//2-1])
    return


def D():
    n = I()

    return


def E():
    n = I()

    return


def F():
    n = I()

    return



if __name__ == "__main__":
    C()

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

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

d_list.sort()
print(d_list[N // 2 ] - d_list[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()
d = na()
d.sort()

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

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

print(b - a)

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

cnt = len(D) // 2 - 1

res = D[cnt + 1] - D[cnt]
print(res)

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N = inp()
dd = inpl()
dd.sort()

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

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

Solution (Python):
n = int(input())
d = list(map(int,input().split()))
d.sort()
j = n//2
print(d[j]-d[j-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:
    print(0)
else:
    left = d[n//2-1]
    right = d[n//2]
    print(right-left)

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

Solution (Python):
from collections import defaultdict
import math


def main():
    num = int(input())
    data = list(map(int, input().split()))
    data.sort()
    a, b = data[(num - 1) // 2], data[num // 2]
    print(b- a)






if __name__ == '__main__':
    main()

Solution (Python):
import sys

n = int(input())
ddd = list(map(int, input().split()))
ddd.sort()


a, b = ddd[n // 2 - 1], ddd[n // 2]
print(b - a)