N = int(eval(input()))

left = []

right = []

for _ in range(N):

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

    left.append(l)

    right.append(r)

left.sort()

right.sort()

if N%2==0:

    for i, (l, r) in enumerate(zip(left, right), 1):

        if i==N//2:

            L = l

            R = r

        if i==N//2+1:

            R +=r

            L += l

            print(((R-L)+1))

else:

    for i, (l, r) in enumerate(zip(left, right), 1):

        if i==N//2+1:

            print((r-l+1))
import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



N = int(eval(input()))

As = []

Bs = []

for _ in range(N):

    A, B = mapint()

    As.append(A)

    Bs.append(B)

As.sort()

Bs.sort()



if N%2==1:

    left = As[N//2]

    right = Bs[N//2]

else:

    left = (As[N//2]+As[N//2-1])

    right = (Bs[N//2]+Bs[N//2-1])



print((right-left+1))
N = int(eval(input()))
left = []
right = []
for _ in range(N):
    l, r = list(map(int, input().split()))
    left.append(l)
    right.append(r)
left.sort()
right.sort()
if N % 2 == 0:
    for i, (l, r) in enumerate(zip(left, right), 1):
        if i == N // 2:
            L = l
            R = r
        if i == N // 2 + 1:
            R += r
            L += l
            print(((R - L) + 1))
else:
    for i, (l, r) in enumerate(zip(left, right), 1):
        if i == N // 2 + 1:
            print((r - l + 1))

import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
N = int(eval(input()))
As = []
Bs = []
for _ in range(N):
    A, B = mapint()
    As.append(A)
    Bs.append(B)
As.sort()
Bs.sort()
if N % 2 == 1:
    left = As[N // 2]
    right = Bs[N // 2]
else:
    left = As[N // 2] + As[N // 2 - 1]
    right = Bs[N // 2] + Bs[N // 2 - 1]
print((right - left + 1))

+import sys + + +def input(): +    return sys.stdin.readline().strip() + + +def mapint(): +    return list(map(int, input().split())) + + +sys.setrecursionlimit(10**9) -left = [] -right = [] +As = [] +Bs = [] -    l, r = list(map(int, input().split())) -    left.append(l) -    right.append(r) -left.sort() -right.sort() -if N % 2 == 0: -    for i, (l, r) in enumerate(zip(left, right), 1): -        if i == N // 2: -            L = l -            R = r -        if i == N // 2 + 1: -            R += r -            L += l -            print(((R - L) + 1)) +    A, B = mapint() +    As.append(A) +    Bs.append(B) +As.sort() +Bs.sort() +if N % 2 == 1: +    left = As[N // 2] +    right = Bs[N // 2] -    for i, (l, r) in enumerate(zip(left, right), 1): -        if i == N // 2 + 1: -            print((r - l + 1)) +    left = As[N // 2] + As[N // 2 - 1] +    right = Bs[N // 2] + Bs[N // 2 - 1] +print((right - left + 1))