Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
# AB = np.array([np.array(input().split(), np.int)
AB = np.array(AB)
# tAB = list(zip(*AB))
# print(AB)
tAB = AB.T
# print(tAB)
# print()
A = tAB[0]
B = tAB[1]
A.sort()
B.sort()

# print(A, B)

if N%2 == 0:
    midA1 = A[N//2-1]
    midA2 = A[N//2]
    midB1 = B[N//2-1]
    midB2 = B[N//2]
    d = defaultdict(int)
    for val1 in range(midA1, midB1+1):
        for val2 in range(midA2, midB2+1):
            val = (val1 + val2)/2
            d[val] += 1
    print(len(d.keys()))
    
else:
    midA = A[N//2]
    midB = B[N//2]
    print(midB-midA+1)

Fixed submission:
import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
# AB = np.array([np.array(input().split(), np.int)
AB = np.array(AB)
# tAB = list(zip(*AB))
# print(AB)
tAB = AB.T
# print(tAB)
# print()
A = tAB[0]
B = tAB[1]
A.sort()
B.sort()

# print(A, B)

if N%2 == 0:
    midA1 = A[N//2-1]
    midA2 = A[N//2]
    midB1 = B[N//2-1]
    midB2 = B[N//2]

    midmidA = (midA1+midA2)/2
    midmidB = (midB1+midB2)/2
    res = int((midmidB-midmidA)/(0.5) + 1)
    print(res)

    # d = defaultdict(int)

    # for val1 in range(midA1, midB1+1):
    #     for val2 in range(midA2, midB2+1):
    #         val = (val1 + val2)/2
            # d[val] += 1
    # print(len(d.keys()))
    
else:
    midA = A[N//2]
    midB = B[N//2]
    print(midB-midA+1)

Buggy python submission (verdict: Time Limit Exceeded):
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
tAB = list(zip(*AB))
A = list(tAB[0]).copy()
B = list(tAB[1]).copy()
A.sort()
B.sort()

if N%2 == 0:
    midA1 = A[N//2-1]
    midA2 = A[N//2]
    midB1 = B[N//2-1]
    midB2 = B[N//2]
    d = defaultdict(int)
    for val1 in range(midA1, midB1+1):
        for val2 in range(midA2, midB2+1):
            # print(val1, val2)
            # gcv = gcd(val1, val2)
            # tp = (val1, val2)
            val = (val1 + val2)/2
            d[val] += 1
    # print(d)
    print(len(d.keys()))
    
else:
    midA = A[N//2]
    midB = B[N//2]
    print(midB-midA+1)

Fixed submission:
import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
# AB = np.array([np.array(input().split(), np.int)
AB = np.array(AB)
# tAB = list(zip(*AB))
# print(AB)
tAB = AB.T
# print(tAB)
# print()
A = tAB[0]
B = tAB[1]
A.sort()
B.sort()

# print(A, B)

if N%2 == 0:
    midA1 = A[N//2-1]
    midA2 = A[N//2]
    midB1 = B[N//2-1]
    midB2 = B[N//2]

    midmidA = (midA1+midA2)/2
    midmidB = (midB1+midB2)/2
    res = int((midmidB-midmidA)/(0.5) + 1)
    print(res)

    # d = defaultdict(int)

    # for val1 in range(midA1, midB1+1):
    #     for val2 in range(midA2, midB2+1):
    #         val = (val1 + val2)/2
            # d[val] += 1
    # print(len(d.keys()))
    
else:
    midA = A[N//2]
    midB = B[N//2]
    print(midB-midA+1)