You and your friends live in $n$ houses. Each house is located on a 2D plane, in a point with integer coordinates. There might be different houses located in the same point. The mayor of the city is asking you for places for the building of the Eastern exhibition. You have to find the number of places (points with integer coordinates), so that the summary distance from all the houses to the exhibition is minimal. The exhibition can be built in the same point as some house. The distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ is $|x_1 - x_2| + |y_1 - y_2|$, where $|x|$ is the absolute value of $x$.


-----Input-----

First line contains a single integer $t$ $(1 \leq t \leq 1000)$ — the number of test cases.

The first line of each test case contains a single integer $n$ $(1 \leq n \leq 1000)$. Next $n$ lines describe the positions of the houses $(x_i, y_i)$ $(0 \leq x_i, y_i \leq 10^9)$.

It's guaranteed that the sum of all $n$ does not exceed $1000$.


-----Output-----

For each test case output a single integer - the number of different positions for the exhibition. The exhibition can be built in the same point as some house.


-----Examples-----

Input
6
3
0 0
2 0
1 2
4
1 0
0 2
2 3
3 1
4
0 0
0 1
1 0
1 1
2
0 0
1 1
2
0 0
2 0
2
0 0
0 0
Output
1
4
4
4
3
1


-----Note-----

Here are the images for the example test cases. Blue dots stand for the houses, green — possible positions for the exhibition.

First test case.

Second test case.

Third test case.

Fourth test case.

Fifth test case.

Sixth test case. Here both houses are located at $(0, 0)$.

Difficulty: MEDIUM
Tags: Geometry

Sorting

Shortest paths
Skill types: Sorting

Starter code:

Solutions:
import math as m

def count(zoz, x, y):
	poc = 0
	for i in zoz:
		poc += abs(x - i[0])
		poc += abs(y - i[1])
	return poc
res = []
for _ in range(int(input())):
	n = int(input())
	xes = []
	yes = []
	for i in range(n):
		sur = [int(x) for x in input().split()]
		xes.append(sur[0])
		yes.append(sur[1])
	xes.sort()
	yes.sort()
	x = xes[int(len(xes) / 2)] - xes[int((len(xes) - 1) / 2)] + 1
	y = yes[int(len(yes) / 2)] - yes[int((len(yes) - 1) / 2)] + 1
	res.append(x * y)
for i in res:
	print(i)


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	if n % 2 == 0:
		for i in range(n):
			(x1, y1) = map(int, input().split())
			x.append(x1)
			y.append(y1)
		x = sorted(x)
		y = sorted(y)
		medx = x[n // 2] - x[n // 2 - 1] + 1
		medy = y[n // 2] - y[n // 2 - 1] + 1
		print(medx * medy)
	else:
		for i in range(n):
			(x1, y1) = map(int, input().split())
			x.append(x1)
			y.append(y1)
		print(1)


t = int(input())
for _ in range(t):
	n = int(input())
	xa = []
	ya = []
	for i in range(n):
		(x, y) = map(int, input().split())
		xa.append(x)
		ya.append(y)
	if n % 2 == 1:
		print(1)
	else:
		xa = sorted(xa)
		ya = sorted(ya)
		xs = xa[n // 2] + 1 - xa[n // 2 - 1]
		ys = ya[n // 2] + 1 - ya[n // 2 - 1]
		print(xs * ys)


import math
t = int(input())
for i in range(t):
	n = int(input())
	xlist = []
	ylist = []
	for j in range(n):
		l1 = input().split(' ')
		x = int(l1[0])
		y = int(l1[1])
		xlist.append(x)
		ylist.append(y)
	if n % 2 == 1:
		print(1)
	else:
		xlist.sort()
		ylist.sort()
		mid = n // 2 - 1
		xd = xlist[mid + 1] - xlist[mid] + 1
		yd = ylist[mid + 1] - ylist[mid] + 1
		print(xd * yd)


T = int(input())
while T > 0:
	T -= 1
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(a, b) = list(map(int, input().split()))
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	if n % 2 == 0:
		xs = x[n // 2] - x[n // 2 - 1] + 1
		ys = y[n // 2] - y[n // 2 - 1] + 1
		print(xs * ys)
	else:
		print(1)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=-10 ** 6, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=10 ** 6, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(200001)]
pp = [0] * 200001

def SieveOfEratosthenes(n=200000):
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
t = int(input())

def solve(x):
	x.sort()
	return x[len(x) // 2] - x[(len(x) - 1) // 2] + 1
for i in range(t):
	n = int(input())
	(x, y) = ([], [])
	for j in range(n):
		(px, py) = map(int, input().split())
		x.append(px)
		y.append(py)
	print(solve(x) * solve(y))


import sys
t = int(input())

def find(x):
	x.sort()
	return x[len(x) // 2] - x[(len(x) - 1) // 2] + 1
for _ in range(t):
	n = int(input())
	x = list()
	y = list()
	for _ in range(n):
		(x1, y1) = map(int, input().split())
		x.append(x1)
		y.append(y1)
	x = sorted(x)
	y = sorted(y)
	print(find(x) * find(y))


for t in range(int(input())):
	n = int(input())
	x_arr = []
	y_arr = []
	for i in range(n):
		(x, y) = map(int, input().split())
		x_arr.append(x)
		y_arr.append(y)
	x_arr.sort()
	y_arr.sort()
	if n % 2 == 1:
		print(1)
	else:
		midx1 = x_arr[n // 2 - 1]
		midx2 = x_arr[n // 2]
		midy1 = y_arr[n // 2 - 1]
		midy2 = y_arr[n // 2]
		print((midx2 - midx1 + 1) * (midy2 - midy1 + 1))


t = int(input())
for i in range(t):
	n = int(input())
	x = []
	y = []
	for j in range(n):
		b = list(map(int, input().split()))
		x.append(b[0])
		y.append(b[1])
	if n % 2 == 1:
		print(1)
	else:
		x.sort()
		y.sort()
		print((x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1))


for t in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(x0, y0) = [int(x) for x in input().split()]
		x.append(x0)
		y.append(y0)
	if n % 2 == 1:
		print(1)
	else:
		x.sort()
		y.sort()
		print((x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1))


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

def mapIn():
	return map(int, input().split())
for ii in range(int(input())):
	n = int(input())
	x = [0] * n
	y = [0] * n
	for i in range(n):
		(x[i], y[i]) = mapIn()
	if n % 2 == 1:
		print(1)
		continue
	x.sort()
	y.sort()
	i = n // 2
	print((x[i] - x[i - 1] + 1) * (y[i] - y[i - 1] + 1))


from pprint import pprint
import sys
input = sys.stdin.readline

def do():
	n = int(input())
	(tx, ty) = (0, 0)
	dat = []
	candidates = []
	for i in range(n):
		(x, y) = map(int, input().split())
		dat.append((x, y))
	if n % 2 == 1:
		print(1)
		return
	dat.sort(key=lambda x: x[0])
	(x1, y1) = dat[n // 2 - 1]
	(x2, y2) = dat[n // 2]
	finalres = x2 - x1 + 1
	dat.sort(key=lambda x: x[1])
	(x1, y1) = dat[n // 2 - 1]
	(x2, y2) = dat[n // 2]
	finalres *= y2 - y1 + 1
	print(finalres)
q = int(input())
for _ in range(q):
	do()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	for j in range(int(input())):
		n = int(input())
		x = [0] * n
		y = [0] * n
		for s in range(n):
			(a, b) = map(int, input().split())
			x[s] = a
			y[s] = b
		if n % 2 == 1:
			print(1)
		else:
			x.sort()
			y.sort()
			t1 = x[n // 2] + 1 - x[n // 2 - 1]
			t2 = y[n // 2] + 1 - y[n // 2 - 1]
			print(t1 * t2)
main()


def solve(a):
	a.sort()
	n = len(a)
	return a[n // 2] - a[(n - 1) // 2] + 1
for _ in range(int(input())):
	n = int(input())
	(x, y) = ([], [])
	for _ in range(n):
		(cx, cy) = map(int, input().split())
		x.append(cx)
		y.append(cy)
	print(solve(x) * solve(y))


import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
	n = int(sys.stdin.readline().strip())
	(xs, ys) = ([], [])
	for __ in range(n):
		(x, y) = map(int, sys.stdin.readline().strip().split())
		xs.append(x)
		ys.append(y)
	if n % 2 == 1:
		print(1)
		continue
	xs.sort()
	ys.sort()
	med = int(n / 2)
	print((ys[med] - ys[med - 1] + 1) * (xs[med] - xs[med - 1] + 1))


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	hx = []
	hy = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		hx.append(x)
		hy.append(y)
	hx.sort()
	hy.sort()
	if n % 2 == 1:
		print(1)
	else:
		print((hx[n // 2] - hx[n // 2 - 1] + 1) * (hy[n // 2] - hy[n // 2 - 1] + 1))


t = int(input())
for i in range(t):
	n = int(input())
	x = [0] * n
	y = [0] * n
	for j in range(n):
		(x1, y1) = map(int, input().split())
		x[j] = x1
		y[j] = y1
	ans = 0
	x.sort()
	y.sort()
	if n % 2 == 0:
		lo = int((n - 2) / 2)
		hi = int(n / 2)
		if x[lo] == x[hi] and y[lo] == y[hi]:
			ans = 1
		elif x[lo] == x[hi]:
			ans = y[hi] - y[lo] + 1
		elif y[lo] == y[hi]:
			ans = x[hi] - x[lo] + 1
		else:
			ans = (x[hi] - x[lo] + 1) * (y[hi] - y[lo] + 1)
		print(ans)
	else:
		print(1)


for _ in range(int(input())):
	n = int(input())
	x = [0] * n
	y = [0] * n
	for i in range(n):
		(x[i], y[i]) = map(int, input().split())
	if n % 2:
		print(1)
	else:
		x.sort()
		y.sort()
		mid = n // 2
		print((x[mid] - x[mid - 1] + 1) * (y[mid] - y[mid - 1] + 1))


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	l1 = []
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append(x)
		l1.append(y)
	l.sort()
	l1.sort()
	if n % 2 == 1:
		print(1)
	else:
		a = l[n // 2] - l[n // 2 - 1] + 1
		b = l1[n // 2] - l1[n // 2 - 1] + 1
		print(a * b)


import sys
input = sys.stdin.readline
t = int(input())
for you in range(t):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		l = input().split()
		a = int(l[0])
		b = int(l[1])
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	pro = 1
	if len(x) % 2 == 0:
		a = len(x)
		z = x[a // 2]
		z -= x[(a - 2) // 2]
		pro = pro * (z + 1)
	if len(y) % 2 == 0:
		a = len(y)
		z = y[a // 2]
		z -= y[(a - 2) // 2]
		pro = pro * (z + 1)
	print(pro)


for _ in range(int(input())):
	n = int(input())
	X = []
	Y = []
	for i in range(n):
		(x, y) = map(int, input().split())
		X.append(x)
		Y.append(y)
	X.sort()
	Y.sort()
	print((X[(n + 2) // 2 - 1] - X[(n + 1) // 2 - 1] + 1) * (Y[(n + 2) // 2 - 1] - Y[(n + 1) // 2 - 1] + 1))


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	if n % 2 == 1:
		print(1)
		continue
	x.sort()
	y.sort()
	ans = (x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	x = [0] * n
	y = [0] * n
	for i in range(n):
		house = list(map(int, input().split()))
		(x[i], y[i]) = (house[0], house[1])
	ans = 1
	x.sort()
	y.sort()
	if n % 2 == 0:
		kx = x[n // 2] - x[n // 2 - 1] + 1
		ky = y[n // 2] - y[n // 2 - 1] + 1
		ans = kx * ky
	print(ans)


def solve(x):
	x.sort()
	return x[len(x) // 2] - x[(len(x) - 1) // 2] + 1
for i in range(int(input())):
	px = []
	py = []
	for j in range(int(input())):
		(x, y) = map(int, input().split())
		px.append(x)
		py.append(y)
	print(solve(px) * solve(py))


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(xi, yi) = map(int, input().split())
		x.append(xi)
		y.append(yi)
	x.sort()
	y.sort()
	if n % 2 == 1:
		print(1)
		continue
	dx = x[n // 2] - x[n // 2 - 1] + 1
	dy = y[n // 2] - y[n // 2 - 1] + 1
	print(dx * dy)


def solve() -> int:
	n = int(input())
	xs = []
	ys = []
	for _ in range(0, n):
		coordinate = input().split()
		xs.append(int(coordinate[0]))
		ys.append(int(coordinate[1]))
	if n % 2 == 1:
		return 1
	else:
		xs.sort()
		ys.sort()
		dx = xs[n // 2] - xs[n // 2 - 1] + 1
		dy = ys[n // 2] - ys[n // 2 - 1] + 1
		return dx * dy
t = int(input())
for _ in range(0, t):
	ans = solve()
	print(ans)
pass


for T in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(_x, _y) = map(int, input().split())
		x.append(_x)
		y.append(_y)
	x.sort()
	y.sort()
	if len(x) % 2 == 1:
		a = 1
	else:
		a = x[len(x) // 2] - x[len(x) // 2 - 1] + 1
	if len(y) % 2 == 1:
		b = 1
	else:
		b = y[len(y) // 2] - y[len(y) // 2 - 1] + 1
	print(a * b)


import math, sys
from collections import defaultdict, Counter, deque
from bisect import bisect_left, bisect_right
INF = float('inf')
MOD = int(1000000000.0) + 7
MAX = int(1000000.0) + 1

def b():
	n = int(input())
	arr = []
	cx = cy = 0
	for i in range(n):
		(x, y) = vars()
		arr.append([x, y])
	sx = sorted(arr)
	sy = sorted(arr, key=lambda x: x[::-1])
	if n % 2 == 0:
		cx1 = n // 2 - 1
		cx2 = n // 2
		cy1 = n // 2 - 1
		cy2 = n // 2
		ans = sx[cx2][0] - sx[cx1][0] + 1
		ans *= sy[cy2][1] - sy[cy1][1] + 1
	else:
		ans = 1
	print(ans)

def c():
	n = int(input())
	(l, r) = (0, n - 1)
	mem = {}
	while l < r:
		m = (l + r) // 2
		print(f'? {l + 1} {r + 1}')
		sys.stdout.flush()
		sm = int(input()) - 1
		mem[l, r] = sm
		sm1 = -1
		if l < sm:
			if (l, sm) not in mem:
				print(f'? {l + 1} {sm + 1}')
				sys.stdout.flush()
				sm1 = int(input()) - 1
			else:
				sm1 = mem[l, sm]
		if sm == sm1:
			r = sm - 1
		else:
			l = sm + 1
	print('!', l + 1)

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		b()

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def input():
	return sys.stdin.readline().rstrip('\n').strip()

def print(*args, sep=' ', end='\n'):
	first = True
	for arg in args:
		if not first:
			sys.stdout.write(sep)
		sys.stdout.write(str(arg))
		first = False
	sys.stdout.write(end)
primes = [1 for i in range(MAX)]

def sieve():
	global primes
	primes[0] = primes[1] = 0
	i = 2
	while i <= MAX ** 0.5:
		j = i * i
		while primes[i] and j < MAX:
			if j % i == 0:
				primes[j] = 0
			j += i
		i += 1

def vars():
	return map(int, input().split())

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


import sys
input = lambda : sys.stdin.readline().rstrip()
from collections import defaultdict
import math
for _ in range(int(input())):
	N = int(input())
	(X, Y) = ([], [])
	for _ in range(N):
		(x, y) = map(int, input().split())
		X.append(x)
		Y.append(y)
	if N % 2:
		print(1)
	else:
		X.sort()
		Y.sort()
		ans = (X[N // 2] - X[N // 2 - 1] + 1) * (Y[N // 2] - Y[N // 2 - 1] + 1)
		print(ans)


from collections import *
from bisect import *
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

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

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	n = inp()
	x = []
	y = []
	r = []
	for i in range(n):
		(a, b) = ma()
		r.append([a, b])
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	f = 0
	if len(x) % 2 and len(y) % 2:
		print(1)
		continue
	if len(x) % 2:
		f = 1
	else:
		f = abs(x[len(x) // 2] - x[len(x) // 2 - 1]) + 1
	if len(y) % 2:
		f *= 1
	else:
		f *= abs(y[len(y) // 2] - y[len(y) // 2 - 1]) + 1
	print(f)


t = int(input())
for _ in range(t):
	n = int(input())
	xs = []
	ys = []
	coords = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		xs.append(x)
		ys.append(y)
		coords.append((x, y))
	xs.sort()
	ys.sort()
	if n & 1:
		print(1)
	else:
		xdiff = xs[n // 2] - xs[n // 2 - 1] + 1
		ydiff = ys[n // 2] - ys[n // 2 - 1] + 1
		print(xdiff * ydiff)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
for _ in range(int(inp())):
	n = iinp()
	(xl, yl) = ([], [])
	(sx, sy) = (0, 0)
	for i in range(n):
		(x, y) = mp()
		xl.append(x)
		yl.append(y)
	xl.sort()
	yl.sort()
	(xp, yp) = (1, 1)
	(lx, rx) = (min(xl), max(xl))
	if n % 2 == 0:
		xp = xl[n // 2] - xl[n // 2 - 1] + 1
		yp = yl[n // 2] - yl[n // 2 - 1] + 1
	print(xp * yp)


def main(h, n):
	if n % 2 == 1:
		return 1
	(x, y) = ([], [])
	solns = 0
	for hh in h:
		x.append(hh[0])
		y.append(hh[1])
	x.sort()
	y.sort()
	if x[0] == x[-1] and y[0] == y[-1]:
		return 1
	elif y[0] == y[-1]:
		return x[n // 2] - x[(n - 1) // 2] + 1
	elif x[0] == x[-1]:
		return y[n // 2] - y[(n - 1) // 2] + 1
	else:
		return (x[n // 2] - x[(n - 1) // 2] + 1) * (y[n // 2] - y[(n - 1) // 2] + 1)
t = int(input())
for i in range(t):
	n = int(input())
	h = []
	for j in range(n):
		(x, y) = input().split()
		h.append([int(x), int(y)])
	print(main(h, n))


for _ in range(int(input())):
	n = int(input())
	(x, y) = ([], [])
	for i in range(n):
		(x1, y1) = map(int, input().split())
		x.append(x1)
		y.append(y1)
	(x.sort(), y.sort())
	ans = x[n // 2] - x[(n - 1) // 2] + 1
	ans *= y[n // 2] - y[(n - 1) // 2] + 1
	print(ans)


a = int(input())
for x in range(a):
	b = int(input())
	h = []
	m = []
	for y in range(b):
		(d, e) = map(int, input().split())
		h.append(d)
		m.append(e)
	h.sort()
	m.sort()
	if b & 1 == 1:
		print(1)
	else:
		print((h[b // 2] - h[b // 2 - 1] + 1) * (m[b // 2] - m[b // 2 - 1] + 1))


question_num = int(input())
ans = []
for i in range(question_num):
	point_num = int(input())
	x_list = []
	y_list = []
	for j in range(point_num):
		[x, y] = [int(str1) for str1 in input().split()]
		x_list.append(x)
		y_list.append(y)
	if point_num % 2:
		ans.append(1)
		continue
	x_list.sort()
	y_list.sort()
	x_num = x_list[point_num // 2] - x_list[point_num // 2 - 1] + 1
	y_num = y_list[point_num // 2] - y_list[point_num // 2 - 1] + 1
	ans.append(x_num * y_num)
for an in ans:
	print(an)


from collections import Counter
import math
for _ in range(int(input())):
	n = int(input())
	(lx, ly) = ([], [])
	for i in range(n):
		(x, y) = map(int, input().split())
		lx.append(x)
		ly.append(y)
	if n % 2 == 1:
		print(1)
		continue
	lx.sort()
	ly.sort()
	d1 = lx[n // 2] - lx[(n - 1) // 2] + 1
	d2 = ly[n // 2] - ly[(n - 1) // 2] + 1
	print(d1 * d2)


import sys
from math import ceil
from _collections import deque
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for _ in range(n):
		(x1, y1) = map(int, input().split())
		x.append(x1)
		y.append(y1)
	x.sort()
	y.sort()
	t1 = (n + 1) // 2 - 1
	t2 = (n + 2) // 2 - 1
	print((x[t2] - x[t1] + 1) * (y[t2] - y[t1] + 1))


import logging
import sys
from inspect import currentframe
input = sys.stdin.readline
logging.basicConfig(level=logging.DEBUG)

def dbg(*args):
	id2names = {id(v): k for (k, v) in currentframe().f_back.f_locals.items()}
	logging.debug(', '.join((id2names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args)))

def solve():
	n = int(input())
	x = [0] * n
	y = [0] * n
	for i in range(n):
		(x[i], y[i]) = map(int, input().split())
	x.sort()
	y.sort()
	if n % 2 == 1:
		mx = x[n // 2]
		my = y[n // 2]
		return 1
	else:
		mx1 = x[n // 2 - 1]
		mx2 = x[n // 2]
		my1 = y[n // 2 - 1]
		my2 = y[n // 2]
		ans = (mx2 - mx1 + 1) * (my2 - my1 + 1)
		return ans

def main():
	t = int(input())
	for _ in range(t):
		print(solve())
main()


from sys import stdin as si, stdout as so
for _ in range(int(si.readline())):
	n = int(si.readline())
	x = [0] * n
	y = [0] * n
	for i in range(n):
		(x[i], y[i]) = map(int, si.readline().split())
	x.sort()
	y.sort()
	xi = x[n // 2] - x[(n - 1) // 2] + 1
	yi = y[n // 2] - y[(n - 1) // 2] + 1
	so.write(str(xi * yi) + '\n')


n = int(input())
ans = []
for i in range(n):
	a = int(input())
	x = []
	y = []
	for j in range(a):
		(k, l) = (int(num) for num in input().split())
		x.append(k)
		y.append(l)
	if a % 2 == 1:
		ans.append(1)
		continue
	x.sort()
	y.sort()
	ans.append((x[a // 2] - x[a // 2 - 1] + 1) * (y[a // 2] - y[a // 2 - 1] + 1))
for i in ans:
	print(i)


import math
for _ in range(int(input())):
	n = int(input())
	(x, y, l) = ([], [], [])
	for i in range(n):
		l.append(list(map(int, input().split())))
		x.append(l[-1][0])
		y.append(l[-1][1])
	if n % 2 == 1:
		print(1)
		continue
	else:
		x.sort()
		y.sort()
		(x1, x2) = (x[n // 2], x[n // 2 - 1])
		(y1, y2) = (y[n // 2], y[n // 2 - 1])
		print((x1 - x2 + 1) * (y1 - y2 + 1))


def solve(arr):
	arr.sort()
	n = len(arr)
	return arr[n // 2] - arr[(n - 1) // 2] + 1
for _ in range(int(input())):
	n = int(input())
	(x, y) = ([0] * n, [0] * n)
	for i in range(n):
		(x[i], y[i]) = map(int, input().split())
	print(solve(x) * solve(y))


from collections import defaultdict
q = int(input())
for _ in range(q):
	n = int(input())
	able = 1
	lst = []
	dct = defaultdict(int)
	for i in range(n):
		(a, b) = map(int, input().split())
		lst.append((a, b))
	lst.sort()
	if n % 2:
		x1 = lst[n // 2][0]
		x2 = lst[n // 2][0]
	else:
		x1 = lst[n // 2 - 1][0]
		x2 = lst[n // 2][0]
	lst.sort(key=lambda tup: tup[1])
	if n % 2:
		y1 = lst[n // 2][1]
		y2 = lst[n // 2][1]
	else:
		y1 = lst[n // 2 - 1][1]
		y2 = lst[n // 2][1]
	ans = (x2 - x1 + 1) * (y2 - y1 + 1)
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arrx = []
	arry = []
	for i in range(n):
		l = list(map(int, input().split()))
		arrx.append(l[0])
		arry.append(l[1])
	arrx.sort()
	arry.sort()
	if n % 2 == 1:
		print(1)
	else:
		k = 0
		possx = arrx[n // 2] - arrx[n // 2 - 1] + 1
		possy = arry[n // 2] - arry[n // 2 - 1] + 1
		print(possx * possy)


def yerin(n, x, y):
	if n % 2 == 1:
		return 1
	else:
		if x[int(n / 2) - 1] == x[int(n / 2)]:
			a = 1
		else:
			a = 1 - x[int(n / 2) - 1] + x[int(n / 2)]
		if y[int(n / 2) - 1] == y[int(n / 2)]:
			b = 1
		else:
			b = 1 - y[int(n / 2) - 1] + y[int(n / 2)]
		return a * b
t = int(input())
for i in range(t):
	n = int(input())
	x = []
	y = []
	for j in range(n):
		(p, q) = map(int, input().split())
		x.append(p)
		y.append(q)
	x.sort()
	y.sort()
	print(yerin(n, x, y))


t = int(input())
for _ in range(t):
	n = int(input())
	(x, y) = ([0] * n, [0] * n)
	for i in range(n):
		(x[i], y[i]) = list(map(int, input().split()))
	x.sort()
	y.sort()
	if n % 2:
		ans = 1
	else:
		half = n // 2
		xways = x[half] - x[half - 1] + 1
		yways = y[half] - y[half - 1] + 1
		ans = xways * yways
	print(ans)


class Solution:

	def decide_loc(self, rows, cols):
		row = sorted(rows)
		col = sorted(cols)
		if len(row) % 2 == 0:
			return (row[int((len(row) - 1) / 2) + 1] - row[int((len(row) - 1) / 2)] + 1) * (col[int((len(row) - 1) / 2) + 1] - col[int((len(row) - 1) / 2)] + 1)
		else:
			return 1
s = Solution()
n = int(input())
for i in range(n):
	t = int(input())
	rows = []
	cols = []
	for indx in range(t):
		st = input()
		row = int(st.split()[0])
		col = int(st.split()[1])
		rows.append(row)
		cols.append(col)
	print(s.decide_loc(rows, cols))


import sys
import math
t = int(input())
for i in range(t):
	n = int(input())
	(x, y) = ([], [])
	for j in range(n):
		(px, py) = map(int, input().split())
		x.append(px)
		y.append(py)
	x.sort()
	y.sort()
	print((x[n // 2] - x[(n - 1) // 2] + 1) * (y[n // 2] - y[(n - 1) // 2] + 1))


for _ in range(int(input())):
	n = int(input())
	x = [0] * n
	y = [0] * n
	for i in range(n):
		tmp = list(map(int, input().split()))
		x[i] = tmp[0]
		y[i] = tmp[1]
	ans = 1
	x.sort()
	y.sort()
	if n % 2 == 0:
		k = x[n // 2] - x[n // 2 - 1] + 1
		k2 = y[n // 2] - y[n // 2 - 1] + 1
		ans = k * k2
	print(ans)


import sys, os, io
from sys import stdin
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import math
alphabets = list('abcdefghijklmnopqrstuvwxyz')

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def si():
	return input()

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def ii():
	return int(input())

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')

def power_set(L):
	cardinality = len(L)
	n = 2 ** cardinality
	powerset = []
	for i in range(n):
		a = bin(i)[2:]
		subset = []
		for j in range(len(a)):
			if a[-j - 1] == '1':
				subset.append(L[j])
		powerset.append(subset)
	powerset_orderred = []
	for k in range(cardinality + 1):
		for w in powerset:
			if len(w) == k:
				powerset_orderred.append(w)
	return powerset_orderred

def fastPlrintNextLines(a):
	print('\n'.join(map(str, a)))
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = 1
t = int(input())

def fun(x, y):
	ans = 0
	for i in range(n):
		ans += abs(x - l[i][0]) + abs(y - l[i][1])
	return ans
for _ in range(t):
	n = ii()
	l = []
	x = []
	y = []
	for i in range(n):
		(w, e) = li()
		x.append(w)
		y.append(e)
	if n % 2 == 1:
		print(1)
	else:
		x.sort()
		y.sort()
		print((x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1))


t = int(input())
while t != 0:
	n = int(input())
	a = []
	b = []
	for i in range(0, n):
		(x, y) = map(int, input().split())
		a.append(x)
		b.append(y)
	a.sort()
	b.sort()
	if n % 2 == 1:
		print(1)
	else:
		print((a[n // 2] - a[n // 2 - 1] + 1) * (b[n // 2] - b[n // 2 - 1] + 1))
	t = t - 1


def main(a, b):
	n = len(a)
	a.sort()
	b.sort()
	if n % 2 == 0:
		x = n // 2
		y = n // 2 - 1
	else:
		return 1
	return (a[x] - a[y] + 1) * (b[x] - b[y] + 1)
t = int(input())
for i in range(t):
	n = int(input())
	a = [0] * n
	b = [0] * n
	for j in range(n):
		str_arr = input().split(' ')
		arr = [int(num) for num in str_arr]
		a[j] = arr[0]
		b[j] = arr[1]
	print(main(a, b))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline()

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

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

def N():
	return int(input())

def S():
	return input().strip()

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	n = N()
	(x, y) = ([0] * n, [0] * n)
	if n & 1:
		for _ in range(n):
			input()
		print(1)
		continue
	for i in range(n):
		(x[i], y[i]) = RL()
	x.sort()
	y.sort()
	k = n >> 1
	print((x[k] - x[k - 1] + 1) * (y[k] - y[k - 1] + 1))


def main():
	T = int(input())
	for _ in range(T):
		n = input().strip()
		n = int(n)
		x = [0 for i in range(n)]
		y = [0 for i in range(n)]
		for i in range(n):
			(p, q) = map(int, input().split())
			x[i] = p
			y[i] = q
		x = sorted(x)
		y = sorted(y)
		sx = sum(x)
		sy = sum(y)
		ax = sx / n
		ay = sy / n
		wx = x[n // 2]
		wy = y[n // 2]
		ux = 2 * sx
		uy = 2 * sy
		wx *= n
		wy *= n
		if n % 2 == 1:
			print('1')
		else:
			print((x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1))
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


cases = int(input())
for _ in range(cases):
	n = int(input())
	a = []
	b = []
	for __ in range(n):
		(x, y) = map(int, input().split())
		a.append(x)
		b.append(y)
	if n & 1:
		print(1)
		continue
	a.sort()
	b.sort()
	print((a[n // 2] - a[n // 2 - 1] + 1) * (b[n // 2] - b[n // 2 - 1] + 1))


def median(arr):
	if len(arr) % 2 != 0:
		return (arr[len(arr) // 2], arr[len(arr) // 2])
	return (arr[len(arr) // 2 - 1], arr[len(arr) // 2])
for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	count = 1
	(a, b) = median(x)
	count *= b - a + 1
	(a, b) = median(y)
	count *= b - a + 1
	print(count)


import sys

def solve(arr):
	n = len(arr)
	leftMedian = arr[(n - 1) // 2]
	rightMedian = arr[n // 2]
	noOfPoints = rightMedian - leftMedian + 1
	return noOfPoints
t = int(input())
while t > 0:
	n = int(input())
	xCoord = list()
	yCoord = list()
	while n > 0:
		arr = [int(i) for i in input().strip().split()]
		xCoord.append(arr[0])
		yCoord.append(arr[1])
		n -= 1
	xCoord.sort()
	yCoord.sort()
	answer = solve(xCoord) * solve(yCoord)
	sys.stdout.write(str(answer) + '\n')
	t -= 1


def solve(x, y, n):
	if n % 2 == 0:
		a = median(x)
		b = median(y)
		return a * b
	else:
		return 1

def median(arr):
	arr.sort()
	n = len(arr)
	x = arr[n // 2 - 1]
	y = arr[n // 2]
	return y - x + 1
t = int(input())
for _ in range(t):
	n = int(input())
	x = list()
	y = list()
	for _ in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	print(solve(x, y, n))


import sys
zz = 1
sys.setrecursionlimit(10 ** 5)
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def ii():
	return input().rstrip()

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def dadd(d, p, val):
	if p in d:
		d[p].append(val)
	else:
		d[p] = [val]

def gi():
	return [xx for xx in input().split()]

def gtc(tc, ans):
	print('Case #' + str(tc) + ':', ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def prec(a, pre):
	for i in a:
		pre.append(pre[-1] + i)
	pre.pop(0)

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
uu = t
while t > 0:
	t -= 1
	n = fi()
	x = []
	y = []
	for i in range(n):
		(p, q) = mi()
		x.append(p)
		y.append(q)
	x.sort()
	y.sort()
	if n % 2:
		print(1)
	else:
		a = y[n // 2 - 1]
		b = y[n // 2]
		p = b - a + 1
		a = x[n // 2 - 1]
		b = x[n // 2]
		q = b - a + 1
		print(p * q)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [0] * (n + 1)
	b = [0] * (n + 1)
	for i in range(1, n + 1):
		(x, y) = map(int, input().split())
		a[i] = x
		b[i] = y
	a.sort()
	b.sort()
	if n % 2 == 1:
		print('1', end='\n')
		continue
	ans = (a[n // 2 + 1] - a[n // 2] + 1) * (b[n // 2 + 1] - b[n // 2] + 1)
	print(ans, end='\n')


def fun(a, b, val):
	a = sorted(a)
	b = sorted(b)
	if val % 2 != 0:
		print(1)
	else:
		median1 = val // 2
		median2 = median1 - 1
		x_median1 = a[median1]
		x_median2 = a[median2]
		y_median1 = b[median1]
		y_median2 = b[median2]
		x_med = x_median1 - x_median2 + 1
		y_med = y_median1 - y_median2 + 1
		print(x_med * y_med)
T = int(input())
for i in range(T):
	val = int(input())
	X = []
	Y = []
	for i in range(val):
		(x, y) = list(map(int, input().split()))
		X.append(x)
		Y.append(y)
	fun(X, Y, val)


t = int(input())
while t:
	t -= 1
	n = int(input())
	xi = []
	yi = []
	for i in range(n):
		(x, y) = map(int, input().split())
		xi.append(x)
		yi.append(y)
	xi = sorted(xi)
	yi = sorted(yi)
	if n % 2 == 1:
		values = 1
	else:
		values = (abs(xi[n // 2] - xi[n // 2 - 1]) + 1) * (abs(yi[n // 2] - yi[n // 2 - 1]) + 1)
	print(values)


p = lambda : list(map(int, input().split()))
T = p()[0]
for _ in range(T):
	N = p()[0]
	x = [0] * N
	y = [0] * N
	for i in range(N):
		(x[i], y[i]) = p()
	x.sort()
	y.sort()
	print((x[N // 2] - x[(N - 1) // 2] + 1) * (y[N // 2] - y[(N - 1) // 2] + 1))


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for _ in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	if n % 2 == 1:
		print(1)
	else:
		x.sort()
		y.sort()
		print((x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1))


for _ in range(int(input())):
	n = int(input())
	x_map = dict()
	y_map = dict()
	min_y = 1000000001
	min_x = 1000000001
	for _ in range(n):
		(x, y) = map(int, input().split())
		if y in y_map:
			y_map[y] += 1
		else:
			y_map[y] = 1
		if x in x_map:
			x_map[x] += 1
		else:
			x_map[x] = 1
		min_y = min(y, min_y)
		min_x = min(x, min_x)
	best_y = 1
	best_x = 1
	if n % 2 == 1:
		print(1)
		continue
	last_y = min_y
	left = 0
	for y in sorted(y_map):
		if left == n // 2:
			best_y = y - last_y + 1
		if left >= n // 2:
			break
		left += y_map[y]
		last_y = y
	last_x = min_x
	left = 0
	for x in sorted(x_map):
		if left == n // 2:
			best_x = x - last_x + 1
		if left >= n // 2:
			break
		left += x_map[x]
		last_x = x
	print(best_x * best_y)


from sys import stdin, stdout
input = stdin.readline
from random import sample
t = int(input())
from collections import Counter
from math import sqrt, ceil

def f(arr, i, j, d, dist):
	if i == j:
		return
	nn = max(arr[i:j])
	for tl in range(i, j):
		if arr[tl] == nn:
			dist[tl] = d
			f(arr, i, tl, d + 1, dist)
			f(arr, tl + 1, j, d + 1, dist)

def ps(n):
	cp = 0
	while n % 2 == 0:
		n = n // 2
		cp += 1
	for ps in range(3, ceil(sqrt(n)) + 1, 2):
		while n % ps == 0:
			n = n // ps
			cp += 1
	if n != 1:
		return False
	return True

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def factorials(n, r):
	slr = n
	dpr = r
	qlr = 1
	qs = 1
	mod = 10 ** 9 + 7
	for ip in range(n - r + 1, n + 1):
		qlr = qlr * ip % mod
	for ij in range(1, r + 1):
		qs = qs * ij % mod
	ans = qlr * modInverse(qs) % mod
	return ans

def modInverse(b):
	qr = 10 ** 9 + 7
	return pow(b, qr - 2, qr)
tt = [xa ** 3 for xa in range(0, 10 ** 4 + 1)]
qq = set(tt)
for jj in range(t):
	n = int(input())
	arr = []
	sumx = 0
	sumy = 0
	setx = set()
	sety = set()
	lp = []
	lq = []
	for i in range(n):
		arr.append([int(xy) for xy in input().strip().split()])
		lp.append(arr[i][0])
		lq.append(arr[i][1])
	if n % 2 != 0:
		print(1)
		continue
	lp = sorted(lp)
	lq = sorted(lq)
	ij = lp[n // 2 - 1]
	it = lp[n // 2]
	ijj = lq[n // 2 - 1]
	itt = lq[n // 2]
	print((it - ij + 1) * (itt - ijj + 1))


n1 = int(input())
for _ in range(n1):
	n = int(input())
	(x, y) = ([], [])
	for _ in range(n):
		t = [int(item) for item in input().split()]
		x.append(t[0])
		y.append(t[1])
	x.sort()
	y.sort()
	if n % 2 == 1:
		ans = 1
	else:
		ansx = x[int(n / 2)] - x[int(n / 2 - 1)] + 1
		ansy = y[int(n / 2)] - y[int(n / 2 - 1)] + 1
		ans = ansx * ansy
	print(ans)


t = int(input())
for z in range(t):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		inp = input().split()
		x.append(int(inp[0]))
		y.append(int(inp[1]))

	def nbof(x, n):
		x.sort()
		if n % 2 == 1:
			return 1
		return x[int(n / 2)] - x[int((n - 1) / 2)] + 1
	print(nbof(x, n) * nbof(y, n))


import sys
input = sys.stdin.readline

def solution(n, h):
	x = [h[i][0] for i in range(n)]
	y = [h[i][1] for i in range(n)]
	diff_x = 0
	diff_y = 0
	if n % 2 == 1:
		print(1)
		return
	x.sort()
	y.sort()
	diff_x = x[n // 2] - x[n // 2 - 1] + 1
	diff_y = y[n // 2] - y[n // 2 - 1] + 1
	print(diff_x * diff_y)
T = int(input())
for t in range(T):
	n = int(input())
	h = [list(map(int, input().split())) for _ in range(n)]
	solution(n, h)


nb_test = int(input())
for _ in range(nb_test):
	nb_home = int(input())
	homes = []
	X = []
	Y = []
	for _ in range(nb_home):
		homes.append(list(map(int, input().split())))
	if nb_home % 2 != 0:
		print(1)
		continue
	for coord in range(nb_home):
		X.append(homes[coord][0])
		Y.append(homes[coord][1])
	X.sort()
	Y.sort()
	print((X[len(X) // 2] - X[len(X) // 2 - 1] + 1) * (Y[len(Y) // 2] - Y[len(Y) // 2 - 1] + 1))


import collections
import sys
import math
input = sys.stdin.readline
from bisect import bisect_left
from bisect import bisect_right
from functools import cmp_to_key
from collections import defaultdict
from collections import deque
import heapq

def solve():
	t = int(input())
	while t:
		t -= 1
		n = int(input())
		(x, y) = ([], [])
		for _ in range(n):
			(a, b) = list(map(int, input().split()))
			x.append(a)
			y.append(b)
		x.sort()
		y.sort()
		if n % 2 != 0:
			print(1)
			continue
		c = n // 2
		d = n // 2 - 1
		print((x[c] - x[d] + 1) * (y[c] - y[d] + 1))

def main():
	solve()
main()


import math

def getint():
	return [int(i) for i in input().split()]

def getstr():
	return [str(i) for i in input().split()]

def solve():
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	ans1 = 0
	ans2 = 0
	if n % 2 == 0:
		ans1 = x[n // 2] - x[n // 2 - 1] + 1
		ans2 = y[n // 2] - y[n // 2 - 1] + 1
		print(ans1 * ans2)
	else:
		print(1)
for _ in range(int(input())):
	solve()


def solve(x):
	x.sort()
	return x[len(x) // 2] - x[(len(x) - 1) // 2] + 1
t = int(input())
for _ in range(t):
	n = int(input())
	coordinates_x = []
	coordinates_y = []
	for i in range(n):
		(x, y) = map(int, input().split())
		coordinates_x.append(x)
		coordinates_y.append(y)
	print(solve(coordinates_x) * solve(coordinates_y))


T = int(input())
for t in range(T):
	n = int(input())
	lx = []
	ly = []
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		lx.append(x)
		ly.append(y)
	lx.sort()
	ly.sort()
	if len(lx) % 2 == 1:
		nx = 1
	else:
		nx = lx[len(lx) // 2] - lx[len(lx) // 2 - 1] + 1
	if len(ly) % 2 == 1:
		ny = 1
	else:
		ny = ly[len(ly) // 2] - ly[len(ly) // 2 - 1] + 1
	print(nx * ny)


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(xi, yi) = map(int, input().split())
		x.append(xi)
		y.append(yi)
	if n % 2 != 0:
		print(1)
	else:
		x.sort()
		y.sort()
		tx = x[n // 2] - x[n // 2 - 1] + 1
		ty = y[n // 2] - y[n // 2 - 1] + 1
		print(tx * ty)


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	n = int(input())
	X = []
	Y = []
	for i in range(n):
		(x, y) = map(int, input().split())
		X.append(x)
		Y.append(y)
	if n % 2 == 1:
		print(1)
		continue
	X.sort()
	Y.sort()
	XX = X[n // 2] - X[n // 2 - 1]
	YY = Y[n // 2] - Y[n // 2 - 1]
	print((XX + 1) * (YY + 1))


gt = lambda : list(map(int, input().split()))

def pos(ar):
	if len(ar) & 1 == 1:
		return 1
	ar.sort()
	m = len(ar) // 2
	return ar[m] - ar[m - 1] + 1

def run():
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(xx, yy) = gt()
		x.append(xx)
		y.append(yy)
	print(pos(x) * pos(y))
exec('run();' * int(input()))


t = int(input())
for _ in range(t):
	n = int(input())
	(x, y) = ([], [])
	for i in range(n):
		(xi, yi) = [int(i) for i in input().split()]
		x.append(xi)
		y.append(yi)
	x = sorted(x)
	y = sorted(y)
	z = 1
	if n % 2 == 0:
		z = (x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1)
	print(z)


import sys
import heapq
import copy
import math
import decimal
input = sys.stdin.readline
flush = sys.stdout.flush

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def insr2():
	s = input()
	s = list(s[:len(s) - 1])
	s = [ord(s[i]) - ord('a') for i in range(len(s))]
	return s

def invr():
	return map(int, input().split())
ans = 0

def pr_list(a):
	print(*a, sep=' ')

def swap(a, b):
	temp = a
	a = b
	b = temp
	return [a, b]
mod = 1000000007

def pri(a, b):
	s = '? ' + str(a) + ' ' + str(b)
	print(s)
	sys.stdout.flush()

def solve():
	[n, m] = inlt()
	arr = inlt()
	return

def main():
	tests = 1
	tests = inp()
	for test in range(tests):
		n = inp()
		x = []
		y = []
		for i in range(n):
			[px, py] = inlt()
			x.append(px)
			y.append(py)
		if n % 2 == 1:
			print(1)
			continue
		x.sort()
		y.sort()
		mid = n // 2
		print((x[mid] - x[mid - 1] + 1) * (y[mid] - y[mid - 1] + 1))
main()


for i in range(int(input())):
	n = int(input())
	a = []
	b = []
	for j in range(n):
		(x, y) = list(map(int, input().split()))
		a.append(x)
		b.append(y)
	a.sort()
	b.sort()
	if n % 2 == 0:
		c = a[n // 2] - a[n // 2 - 1] + 1
		d = b[n // 2] - b[n // 2 - 1] + 1
	else:
		c = 1
		d = 1
	print(c * d)


def solve():
	n = int(input())
	houses = []
	for i in range(n):
		t = list(map(int, input().split()))
		houses.append(t)
	if len(houses) % 2 != 0:
		print(1)
	else:
		houses.sort(key=lambda x: x[1])
		mid = int(n / 2)
		t1 = houses[mid][1] - houses[mid - 1][1] + 1
		houses.sort(key=lambda x: x[0])
		t2 = houses[mid][0] - houses[mid - 1][0] + 1
		print(t1 * t2)
t = int(input())
for i in range(t):
	solve()


t = int(input())

def sol(X):
	X.sort()
	return X[len(X) // 2] - X[(len(X) - 1) // 2] + 1
for i in range(t):
	n = int(input())
	(X, Y) = ([], [])
	for j in range(n):
		(x, y) = map(int, input().split())
		X.append(x)
		Y.append(y)
	print(sol(X) * sol(Y))


def kol(a, n):
	a.sort()
	return a[n // 2] - a[(n - 1) // 2] + 1
for i in range(int(input())):
	(n, x, y) = (int(input()), [], [])
	for j in range(n):
		(x1, y1) = map(int, input().split())
		x += [x1]
		y += [y1]
	print(kol(x, n) * kol(y, n))


import os
DEBUG = 'DEBUG' in os.environ

def debug(*args):
	if DEBUG:
		print('>', *args)

def solution(houses):
	if len(houses) == 1:
		return 1
	housesX = []
	housesY = []
	for house in houses:
		housesX.append(house[0])
		housesY.append(house[1])
	housesX.sort()
	housesY.sort()
	leftX = -1
	rightX = -1
	topY = -1
	bottomY = -1
	if len(houses) % 2 == 0:
		leftX = housesX[len(houses) // 2 - 1]
		rightX = housesX[len(houses) // 2]
		bottomY = housesY[len(houses) // 2 - 1]
		topY = housesY[len(houses) // 2]
		return (rightX - leftX + 1) * (topY - bottomY + 1)
	if len(houses) % 2 == 1:
		return 1
	debug(leftX, rightX, topY, bottomY)
	return 'NO'
for t in range(int(input())):
	houses = []
	for t2 in range(int(input())):
		houses.append(list(map(int, input().split())))
	print(solution(houses))


import math
t = int(input())
for _ in range(t):
	x = []
	y = []
	n = int(input())
	for i in range(n):
		(a, b) = [int(x) for x in input().split()]
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	print((x[len(x) // 2] - x[(len(x) - 1) // 2] + 1) * (y[len(x) // 2] - y[(len(x) - 1) // 2] + 1))


t = int(input())

def ans(x):
	x.sort()
	return x[len(x) // 2] - x[(len(x) - 1) // 2] + 1
for i in range(t):
	n = int(input())
	x = []
	y = []
	for j in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	print(ans(x) * ans(y))


def solve(n, x):
	a = x[(n - 1) // 2]
	b = x[n // 2]
	return b - a + 1
for _ in range(int(input())):
	n = int(input())
	xs = []
	ys = []
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		xs.append(x)
		ys.append(y)
	xs.sort()
	ys.sort()
	print(solve(n, xs) * solve(n, ys))


import sys
input = iter(sys.stdin.read().splitlines()).__next__

def solve():
	n = int(input())
	coords = [tuple(map(int, input().split())) for _ in range(n)]
	if n % 2:
		return 1
	x = [x for (x, y) in coords]
	y = [y for (x, y) in coords]
	x.sort()
	y.sort()
	x_range = x[n // 2] - x[n // 2 - 1] + 1
	y_range = y[n // 2] - y[n // 2 - 1] + 1
	return x_range * y_range
t = int(input())
output = []
for _ in range(t):
	output.append(solve())
print(*output, sep='\n')


import io
import os
import math
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def minDistance(n, ll):
	ll.sort()
	if n & 1 == 0:
		return ll[n // 2] - ll[n // 2 - 1] + 1
	else:
		return 1
t = int(input())
for _ in range(t):
	n = int(input())
	ll = []
	lll = []
	for i in range(n):
		(x, y) = map(int, input().split())
		ll.append(x)
		lll.append(y)
	print(minDistance(n, ll) * minDistance(n, lll))


for _ in range(int(input())):
	n = int(input())
	X = []
	Y = []
	for _ in range(n):
		lis = [int(x) for x in input().split()]
		X.append(lis[0])
		Y.append(lis[1])
	X.sort()
	Y.sort()
	if n % 2 == 1:
		counterx = 1
		countery = 1
	else:
		counterx = X[n // 2] - X[n // 2 - 1] + 1
		countery = Y[n // 2] - Y[n // 2 - 1] + 1
	print(counterx * countery)


t = int(input())
for z in range(t):
	x_arr = []
	y_arr = []
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().split())
		x_arr.append(x)
		y_arr.append(y)
	x_arr.sort()
	y_arr.sort()
	if n % 2 == 1:
		print(1)
	else:
		print((x_arr[n // 2] - x_arr[n // 2 - 1] + 1) * (y_arr[n // 2] - y_arr[n // 2 - 1] + 1))


import sys
import math
input = sys.stdin.readline
t = int(input())
for test in range(t):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		[a, b] = list(map(int, input().split(' ')))
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	if n % 2 == 1:
		n1 = 1
	else:
		n1 = abs(y[int(n / 2)] - y[int(n / 2) - 1]) + 1
	if n % 2 == 1:
		n2 = 1
	else:
		n2 = abs(x[int(n / 2)] - x[int(n / 2) - 1]) + 1
	print(n1 * n2)


t = int(input())
for _ in range(t):
	n = int(input())
	x = [0 for k in range(n)]
	y = [0 for k in range(n)]
	for k in range(n):
		(x[k], y[k]) = map(int, input().split())
	if n % 2 == 1:
		print(1)
	else:
		x = sorted(x)
		y = sorted(y)
		ans = 1
		if x[n // 2] != x[n // 2 - 1]:
			ans = x[n // 2] - x[n // 2 - 1] + 1
		if y[n // 2] != y[n // 2 - 1]:
			ans *= y[n // 2] - y[n // 2 - 1] + 1
		print(ans)


import sys
input = sys.stdin.readline

def main():
	tests = int(input())
	for t in range(tests):
		n = int(input())
		(x, y) = ([], [])
		for i in range(n):
			(x1, y1) = tuple(map(int, input().split()))
			x += [x1]
			y += [y1]
		if n % 2 == 1:
			print(1)
		else:
			x = sorted(x)
			y = sorted(y)
			x_diff = x[int(len(x) / 2)] - x[int(len(x) / 2) - 1] + 1
			y_diff = y[int(len(y) / 2)] - y[int(len(y) / 2) - 1] + 1
			print(x_diff * y_diff)
main()


def solve():
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(c1, c2) = map(int, input().split())
		x.append(c1)
		y.append(c2)
	x.sort()
	y.sort()
	if n % 2:
		xcnt = 1
		ycnt = 1
	else:
		xcnt = x[n // 2] - x[n // 2 - 1] + 1
		ycnt = y[n // 2] - y[n // 2 - 1] + 1
	print(xcnt * ycnt)
for _ in range(int(input())):
	solve()


import sys
import inspect
import re
import math
if __name__ == 'CP':
	sys.stdin = open('ip.txt', 'r')
	sys.stdout = open('op.txt', 'w')
	sys.stderr = open('error.txt', 'w')

def debug(arg):
	frame = inspect.currentframe()
	try:
		context = inspect.getframeinfo(frame.f_back).code_context
		caller_lines = ''.join([line.strip() for line in context])
		m = re.search('debug\\s*\\((.+?)\\)$', caller_lines)
		if m:
			caller_lines = m.group(1)
		sys.stderr.write(caller_lines + ' = ' + str(arg) + '\n')
	finally:
		del frame
try:
	M = 1000000007

	def byparts(x, n):
		presum = [0 for i in range(n + 1)]
		for i in range(1, n + 1):
			presum[i] = presum[i - 1] + x[i - 1]
		val = [0 for i in range(n)]
		for i in range(n):
			pre = i * x[i] - presum[i]
			suc = presum[n] - presum[i + 1] - (n - i - 1) * x[i]
			val[i] = pre + suc
		mn = min(val)
		s = -1
		ans = 0
		for i in range(n):
			if val[i] == mn:
				if s == -1:
					s = i
					ans = 1
				else:
					ans += x[i] - x[i - 1]
		return ans

	def solve():
		n = int(input())
		x = [0 for i in range(n)]
		y = [0 for i in range(n)]
		for i in range(n):
			(x[i], y[i]) = [int(j) for j in input().split()]
		x.sort()
		y.sort()
		xa = byparts(x, n)
		ya = byparts(y, n)
		print(xa * ya)
		pass

	def main():
		t = 1
		t = int(input())
		for _ in range(t):
			solve()
	main()
except Exception as e:
	sys.stderr.write('ErrOR : ' + e)


import math
for t in range(int(input())):
	n = int(input())
	lis = []
	for i in range(n):
		(a, b) = map(int, input().split())
		lis.append((a + 1, b + 1))
	a = []
	b = []
	for i in lis:
		a.append(i[0])
		b.append(i[1])
	a.sort()
	b.sort()
	if n & 1:
		print(1)
	else:
		x = a[(n + 1) // 2] - a[(n - 1) // 2] + 1
		y = b[(n + 1) // 2] - b[(n - 1) // 2] + 1
		print(x * y)


result = []
cases = int(input())
for i in range(cases):
	n = int(input())
	xarr = [0] * n
	yarr = [0] * n
	for j in range(n):
		(x, y) = map(int, input().split(' '))
		xarr[j] = x
		yarr[j] = y
	xarr.sort()
	yarr.sort()
	ax = xarr[n // 2]
	ay = yarr[n // 2]
	if n % 2 != 0:
		result.append(1)
	else:
		if ax == xarr[n // 2 - 1]:
			m = 1
		else:
			m = ax - xarr[n // 2 - 1] + 1
		if ay == yarr[n // 2 - 1]:
			l = 1
		else:
			l = ay - yarr[n // 2 - 1] + 1
		result.append(m * l)
for _ in result:
	print(_)


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		l = input().split(' ')
		x.append(int(l[0]))
		y.append(int(l[1]))
	x.sort()
	y.sort()
	res = 1
	if n % 2 == 0:
		res *= x[n // 2] - x[n // 2 - 1] + 1
		res *= y[n // 2] - y[n // 2 - 1] + 1
	print(res)


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
from collections import defaultdict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

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

def L():
	return list(map(int, stdin.readline().split()))

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj

def sieve():
	li = [True] * (10 ** 3 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	(prime, cur) = ([0] * 200, 0)
	for i in range(10 ** 3 + 5):
		if li[i] == True:
			prime[cur] = i
			cur += 1
	return prime

def SPF():
	mx = 10 ** 6 + 1
	spf[1] = 1
	for i in range(2, mx):
		if spf[i] == 1000000000.0:
			spf[i] = i
			for j in range(i * i, mx, i):
				if i < spf[j]:
					spf[j] = i
	return

def prime(n, d):
	prm = set()
	while n != 1:
		prm.add(spf[n])
		n = n // spf[n]
	for ele in prm:
		d[ele] = d.get(ele, 0) + 1
	return
mod = 998244353
inf = 10000000000000000

def answer(li):
	n = len(li)
	if n % 2:
		return 1
	else:
		return li[n // 2] - li[n // 2 - 1] + 1

def solve():
	n = II()
	(x, y) = (list(), list())
	for i in range(n):
		(a, b) = IP()
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	print(answer(x) * answer(y))
	return
t = II()
for i in range(t):
	solve()


t = int(input())
for _ in range(t):
	n = int(input())
	xs = []
	ys = []
	for i in range(n):
		(x, y) = map(int, input().split())
		xs.append(x)
		ys.append(y)
	if n % 2 == 1:
		print(1)
		continue
	xs.sort()
	ys.sort()
	print((xs[n // 2] - xs[n // 2 - 1] + 1) * (ys[n // 2] - ys[n // 2 - 1] + 1))


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
import bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range
R = range

def I():
	return int(input())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def NLI(n):
	return [[int(i) for i in input().split()] for i in range(n)]

def NLI_(n):
	return [[int(i) - 1 for i in input().split()] for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RLI(n=8, a=1, b=10):
	return [random.randint(a, b) for i in range(n)]

def RI(a=1, b=10):
	return random.randint(a, b)

def INP():
	N = 100
	n = random.randint(2, N)
	k = random.randint(1, 10 ** 4)
	return [n]

def Rtest(T):
	(case, err) = (0, 0)
	for i in range(T):
		inp = INP()
		a1 = naive(*inp)
		a2 = solve(*inp)
		if a1 != a2:
			print(inp)
			print('naive', a1)
			print('solve', a2)
			err += 1
		case += 1
	print('Tested', case, 'case with', err, 'errors')

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
alp = [chr(ord('a') + i) for i in range(26)]
show_flg = False
show_flg = True
ans = 0
for i in range(I()):
	n = I()
	x = []
	y = []
	p = []
	for i in range(n):
		(a, b) = LI()
		p += ((a, b),)
		x += (a,)
		y += (b,)
	x.sort()
	y.sort()
	X = Y = 0
	if n % 2 == 1:
		m = M = n // 2
	else:
		m = n // 2 - 1
		M = n // 2
	lx = x[m]
	rx = x[M]
	ly = y[m]
	ry = y[M]
	ans = (rx - lx + 1) * (ry - ly + 1)
	print(ans)


R1 = lambda : list(map(int, input().split()))
R2 = lambda : int(input())
t = R2()
for _ in range(t):
	n = R2()
	(X, Y) = ([], [])
	s = 1
	for _ in range(n):
		(x, y) = R1()
		X.append(x)
		Y.append(y)
	for e in (X, Y):
		n = len(e)
		e.sort()
		s *= e[n // 2] - e[(n - 1) // 2] + 1
	print(s)


mod = 1000000007
eps = 10 ** (-9)

def main():
	import sys
	input = sys.stdin.buffer.readline
	for _ in range(int(input())):
		X = []
		Y = []
		N = int(input())
		for _ in range(N):
			(x, y) = map(int, input().split())
			X.append(x)
			Y.append(y)
		X.sort()
		Y.sort()
		if N & 1:
			print(1)
		else:
			print((X[N // 2] - X[N // 2 - 1] + 1) * (Y[N // 2] - Y[N // 2 - 1] + 1))
main()


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(x1, y1) = map(int, input().split())
		x.append(x1)
		y.append(y1)
	if n % 2 != 0:
		print(1)
	else:
		x.sort()
		y.sort()
		z = n // 2
		q = x[z] - x[z - 1] + 1
		w = y[z] - y[z - 1] + 1
		print(q * w)


def solve(z):
	return z[n // 2] + 1 - z[-1 - n // 2]
for _ in range(int(input())):
	n = int(input())
	(x, y) = map(sorted, zip(*(map(int, input().split()) for _ in range(n))))
	print(solve(x) * solve(y))


import sys
r = sys.stdin.readline
for _ in range(int(r())):
	N = int(r())
	y = []
	x = []
	for _ in range(N):
		(a, b) = map(int, r().split())
		y.append(a)
		x.append(b)
	y.sort()
	x.sort()
	if N % 2 == 1:
		print(1)
	else:
		print((y[N // 2] - y[N // 2 - 1] + 1) * (x[N // 2] - x[N // 2 - 1] + 1))


t = int(input())
while t != 0:
	n = int(input())
	x_cor = []
	y_cor = []
	for i in range(n):
		(a, b) = map(int, input().split())
		x_cor.append(a)
		y_cor.append(b)
	x_cor.sort()
	y_cor.sort()
	if n % 2 == 1:
		print(1)
	else:
		mid = n // 2 - 1
		diff = x_cor[mid + 1] - x_cor[mid] + 1
		diff2 = y_cor[mid + 1] - y_cor[mid] + 1
		print(diff * diff2)
	t -= 1


from math import *
import threading
import sys
from collections import *
mod = 10 ** 9
inf = 10 ** 15
yes = 'YES'
no = 'NO'

def npr(n, r):
	return factorial(n) // factorial(n - r) if n >= r else 0

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = -1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def dist(a, b):
	d = abs(a[1] - b[1]) + abs(a[2] - b[2])
	return d

def power_of_n(x, n):
	cnt = 0
	while x % n == 0:
		cnt += 1
		x //= n
	return cnt
import itertools
sys.setrecursionlimit(300000)
for _ in range(int(input()) if True else 1):
	n = int(input())
	(x, y) = ([], [])
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	if n & 1:
		print(1)
	else:
		ans = (x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1)
		print(ans)


def solve():
	n = int(input())
	(a, b) = ([], [])
	for _ in range(n):
		(x, y) = map(int, input().split())
		a.append(x)
		b.append(y)
	a.sort()
	b.sort()
	xx = abs(a[n // 2] - a[(n - 1) // 2]) + 1
	yy = abs(b[n // 2] - b[(n - 1) // 2]) + 1
	print(xx * yy)
tt = int(input())
for _ in range(tt):
	solve()


import sys
import math
from collections import Counter
readln = sys.stdin.readline

def write(obj):
	sys.stdout.write(str(obj))

def readint():
	return int(readln().strip())

def readints():
	return map(int, readln().split())

def readstr():
	return readln().strip()

def readstrs():
	return readln().split()

def write(obj):
	sys.stdout.write(str(obj))

def dbg(*args):
	if __debug__:
		print(' '.join(map(str, args)))

def solve():
	n = readint()
	xs = []
	ys = []
	for _ in range(n):
		(x, y) = readints()
		xs.append(x)
		ys.append(y)

	def get_range(arr):
		mid = len(arr) // 2
		if len(arr) % 2 == 0:
			return arr[mid] - arr[mid - 1] + 1
		else:
			return 1
	xs = sorted(xs)
	ys = sorted(ys)
	return get_range(xs) * get_range(ys)
t = readint()
for _ in range(t):
	ret = solve()
	if type(ret) in [int, str]:
		write(ret)
	else:
		write('\n'.join(ret))
	write('\n')


from os import path
import sys, time
from math import ceil, floor, gcd, log, log2, factorial, sqrt
from collections import defaultdict, Counter, OrderedDict, deque
from itertools import combinations, permutations
from functools import reduce
from operator import mul
maxx = float('inf')
I = lambda : int(sys.stdin.buffer.readline())
tup = lambda : map(int, sys.stdin.buffer.readline().split())
lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
S = lambda : sys.stdin.readline().strip('\n')
grid = lambda r: [lint() for i in range(r)]
stpr = lambda x: sys.stdout.write(f'{x}' + '\n')
star = lambda x: print(' '.join(map(str, x)))
localsys = 0
start_time = time.time()
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def ceill(n, x):
	return (n + x - 1) // x

def f(arr):
	arr.sort()
	return arr[len(arr) // 2] - arr[(len(arr) - 1) // 2] + 1
for _ in range(I()):
	n = I()
	(x, y) = ([], [])
	for i in range(n):
		(X, Y) = tup()
		x.append(X)
		y.append(Y)
	print(f(x) * f(y))
if localsys:
	print('\n\nTime Elased :', time.time() - start_time, 'seconds')


from math import ceil, floor, log
import sys
from heapq import heappush, heappop
from collections import Counter, defaultdict, deque
input = lambda : sys.stdin.readline().strip()
c = lambda x: 10 ** 9 if x == '?' else int(x)

class node:

	def __init__(self, x, y):
		self.a = [x, y]

	def __lt__(self, b):
		return b.a[0] < self.a[0]

	def __repr__(self):
		return str(self.a[0]) + ' ' + str(self.a[1])

def main():
	for _ in range(int(input())):
		n = int(input())
		(a, b) = zip(*[list(map(int, input().split())) for i in range(n)])
		a = list(a)
		b = list(b)
		if n % 2 == 1:
			print(1)
		else:
			a.sort()
			b.sort()
			print(max((b[n // 2 - 1] - b[n // 2] - 1) * (a[n // 2 - 1] - a[n // 2] - 1), 0))
main()


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	l2 = []
	for j in range(n):
		(x, y) = map(int, input().split())
		l.append(x)
		l2.append(y)
	l.sort()
	v = 0
	if len(l) % 2 != 0:
		v = 1
	elif l[len(l) // 2] > l[len(l) // 2 - 1]:
		v = l[len(l) // 2] - l[len(l) // 2 - 1] + 1
	else:
		v = 1
	l2.sort()
	if len(l2) % 2 != 0:
		v *= 1
	elif l2[len(l2) // 2] > l2[len(l2) // 2 - 1]:
		v *= l2[len(l2) // 2] - l2[len(l2) // 2 - 1] + 1
	else:
		v *= 1
	print(v)


for _ in range(int(input())):
	n = int(input())
	arr = []
	for _ in range(n):
		arr.append(list(map(int, input().split())))
	if n % 2 == 1:
		print(1)
	else:
		x = []
		y = []
		for i in arr:
			x.append(i[0])
			y.append(i[1])
		x.sort()
		y.sort()
		ans = (x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1)
		print(ans)


def solve(x):
	x.sort()
	ans = x[len(x) // 2] - x[(len(x) - 1) // 2] + 1
	return ans
for _ in range(int(input())):
	n = int(input())
	(x, y) = ([], [])
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	ans = solve(x) * solve(y)
	print(ans)


T = int(input())
for t in range(T):
	N = int(input())
	points = []
	for i in range(N):
		(x, y) = [int(k) for k in input().split()]
		points.append((x, y))
	xs = sorted([p[0] for p in points])
	ys = sorted([p[1] for p in points])
	x_l = len(xs)
	y_l = len(ys)
	x_count = 0
	if x_l % 2 == 0:
		x_count = xs[x_l // 2] - xs[x_l // 2 - 1] + 1
	else:
		x_count = 1
	y_count = 0
	if y_l % 2 == 0:
		y_count = ys[y_l // 2] - ys[y_l // 2 - 1] + 1
	else:
		y_count = 1
	print(x_count * y_count)


import sys
from collections import deque
input_ = lambda : sys.stdin.readline().strip('\r\n')
ii = lambda : int(input_())
il = lambda : list(map(int, input_().split()))
ilf = lambda : list(map(float, input_().split()))
ip = lambda : input_()
fi = lambda : float(input_())
li = lambda : list(input_())
pr = lambda x: print(x)
f = lambda : sys.stdout.flush()
for _ in range(ii()):
	n = ii()
	a = []
	b = []
	for i in range(n):
		(l, r) = il()
		a.append(l)
		b.append(r)
	a.sort()
	b.sort()
	if n % 2:
		print(1)
	else:
		x = n // 2
		y = x - 1
		print((a[x] - a[y] + 1) * (b[x] - b[y] + 1))


for _ in range(int(input())):
	n = int(input())
	(x, y) = ([], [])
	for i in range(n):
		(currX, currY) = map(int, input().split())
		x.append(currX)
		y.append(currY)
	x.sort()
	y.sort()
	medX = (x[n // 2] - x[n // 2 - 1] if n % 2 == 0 else 0) + 1
	medY = (y[n // 2] - y[n // 2 - 1] if n % 2 == 0 else 0) + 1
	print(medY * medX)


t = int(input())
for i in range(t):
	n = int(input())
	xx = []
	yy = []
	for x in range(n):
		a = [int(z) for z in input().split()]
		xx.append(a[0])
		yy.append(a[1])
	xx = sorted(xx)
	yy = sorted(yy)
	f = (n + 1) // 2
	s = (n + 2) // 2
	print((abs(xx[f - 1] - xx[s - 1]) + 1) * (abs(yy[f - 1] - yy[s - 1]) + 1))


import sys
import re
import random
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
input = sys.stdin.readline
getS = lambda : input().strip()
getN = lambda : int(input())
getList = lambda : list(map(int, input().split()))
getZList = lambda : [int(x) - 1 for x in input().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
divide = lambda x: pow(x, MOD - 2, MOD)

def nck(n, k, kaijyo):
	return npk(n, k, kaijyo) * divide(kaijyo[k]) % MOD

def npk(n, k, kaijyo):
	if k == 0 or k == n:
		return n % MOD
	return kaijyo[n] * divide(kaijyo[n - k]) % MOD

def fact_and_inv(SIZE):
	inv = [0] * SIZE
	fac = [0] * SIZE
	finv = [0] * SIZE
	inv[1] = 1
	fac[0] = fac[1] = 1
	finv[0] = finv[1] = 1
	for i in range(2, SIZE):
		inv[i] = MOD - MOD // i * inv[MOD % i] % MOD
		fac[i] = fac[i - 1] * i % MOD
		finv[i] = finv[i - 1] * inv[i] % MOD
	return (fac, finv)

def renritsu(A, Y):
	A = np.matrix(A)
	Y = np.matrix(Y)
	Y = np.reshape(Y, (-1, 1))
	X = np.linalg.solve(A, Y)
	return X.flatten().tolist()[0]

class TwoDimGrid:

	def __init__(self, h, w, wall='#'):
		self.h = h
		self.w = w
		self.size = (h + 2) * (w + 2)
		self.wall = wall
		self.get_grid()

	def get_grid(self):
		grid = [self.wall * (self.w + 2)]
		for i in range(self.h):
			grid.append(self.wall + getS() + self.wall)
		grid.append(self.wall * (self.w + 2))
		self.grid = grid

	def init_cost(self):
		self.cost = [INF] * self.size

	def pos(self, x, y):
		return y * (self.w + 2) + x

	def getgrid(self, x, y):
		return self.grid[y][x]

	def get(self, x, y):
		return self.cost[self.pos(x, y)]

	def set(self, x, y, v):
		self.cost[self.pos(x, y)] = v
		return

	def show(self):
		for i in range(self.h + 2):
			print(self.cost[(self.w + 2) * i:(self.w + 2) * (i + 1)])

	def showsome(self, tgt):
		for t in tgt:
			print(t)
		return

	def showsomejoin(self, tgt):
		for t in tgt:
			print(''.join(t))
		return

	def search(self):
		grid = self.grid
		move = [(0, 1), (0, -1), (1, 0), (-1, 0)]
		move_eight = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]

class BIT:

	def __init__(self, n):
		self.n = n
		self.BIT = [0] * (n + 2)

	def query(self, idx):
		res_sum = 0
		while idx > 0:
			res_sum += self.BIT[idx]
			idx -= idx & -idx
		return res_sum

	def update(self, idx, x):
		while idx <= self.n:
			self.BIT[idx] += x
			idx += idx & -idx
		return

	def show(self):
		print(self.BIT)

def solve():
	n = getN()
	xs = []
	ys = []
	for i in range(n):
		(x, y) = getList()
		xs.append(x)
		ys.append(y)
	xs.sort()
	ys.sort()
	if n % 2 == 1:
		print(1)
		return
	mindex = n // 2
	xans = xs[mindex] - xs[mindex - 1] + 1
	yans = ys[mindex] - ys[mindex - 1] + 1
	print(xans * yans)

def main():
	n = getN()
	for _ in range(n):
		solve()
	return
main()


from math import floor, ceil
t = int(input())
for i in range(t):
	n = int(input())
	pos = []
	for j in range(n):
		(x, y) = [int(a) for a in input().split()]
		pos.append((x, y))
	xarr = sorted([p[0] for p in pos])
	yarr = sorted([p[1] for p in pos])
	if n % 2 == 1:
		ans = 1
	else:
		if xarr[n // 2 - 1] != xarr[n // 2]:
			xans = xarr[n // 2] - xarr[n // 2 - 1] + 1
		else:
			xans = 1
		if yarr[n // 2 - 1] != yarr[n // 2]:
			yans = yarr[n // 2] - yarr[n // 2 - 1] + 1
		else:
			yans = 1
		ans = xans * yans
	print(ans)


import math as m
q = 1
q = int(input())

def fn(x, y, houses):
	tot = 0
	for house in houses:
		tot += abs(house[0] - x) + abs(house[1] - y)
	return tot
while q:
	q -= 1
	n = int(input())
	(x, y) = ([], [])
	for i in range(n):
		(_x, _y) = map(int, input().split())
		x.append(_x)
		y.append(_y)
	x.sort()
	y.sort()
	(f, s) = (1, 1)
	if n % 2 == 0:
		f = x[n // 2] - x[n // 2 - 1] + 1
		s = y[n // 2] - y[n // 2 - 1] + 1
	print(f * s)


tc = int(input())
while tc > 0:
	a = []
	b = []
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().strip().split())
		a.append(x)
		b.append(y)
	a.sort()
	b.sort()
	m = n // 2
	if n % 2 == 1:
		print(1)
	else:
		print((a[m] - a[m - 1] + 1) * (b[m] - b[m - 1] + 1))
	tc = tc - 1


for _ in range(int(input())):
	n = int(input())
	y = []
	x = []
	for i in range(n):
		(l, r) = map(int, input().split())
		x.append(l)
		y.append(r)
	x.sort()
	y.sort()
	f = x[n // 2] - x[(n - 1) // 2] + 1
	s = y[n // 2] - y[(n - 1) // 2] + 1
	print(f * s)


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

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

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def A(n):
	return [0] * n

def AI(n, x):
	return [x] * n

def G(n):
	return [[] for i in range(n)]

def GP(it):
	return [[ch, len(list(g))] for (ch, g) in groupby(it)]
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
mod = 10 ** 9 + 7
farr = [1]
ifa = []

def fact(x, mod=0):
	if mod:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr) % mod)
	else:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr))
	return farr[x]

def ifact(x, mod):
	global ifa
	fact(x, mod)
	ifa.append(pow(farr[-1], mod - 2, mod))
	for i in range(x, 0, -1):
		ifa.append(ifa[-1] * i % mod)
	ifa.reverse()

def per(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return fact(i) // fact(i - j)
	return farr[i] * ifa[i - j] % mod

def com(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return per(i, j) // fact(j)
	return per(i, j, mod) * ifa[j] % mod

def catalan(n):
	return com(2 * n, n) // (n + 1)

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def floorsum(a, b, c, n):
	if a == 0:
		return b // c * (n + 1)
	if a >= c or b >= c:
		return floorsum(a % c, b % c, c, n) + b // c * (n + 1) + a // c * n * (n + 1) // 2
	m = (a * n + b) // c
	return n * m - floorsum(c, c - b - 1, a, m - 1)

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

def lowbit(n):
	return n & -n

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class ST:

	def __init__(self, arr):
		n = len(arr)
		mx = n.bit_length()
		self.st = [[0] * mx for i in range(n)]
		for i in range(n):
			self.st[i][0] = arr[i]
		for j in range(1, mx):
			for i in range(n - (1 << j) + 1):
				self.st[i][j] = max(self.st[i][j - 1], self.st[i + (1 << j - 1)][j - 1])

	def query(self, l, r):
		if l > r:
			return -inf
		s = (r + 1 - l).bit_length() - 1
		return max(self.st[l][s], self.st[r - (1 << s) + 1][s])

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return flag

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		seen.add(u)
		for (v, w) in graph[u]:
			if v not in d or d[v] > d[u] + w:
				d[v] = d[u] + w
				heappush(heap, (d[v], v))
	return d

def lcm(a, b):
	return a * b // gcd(a, b)

def lis(nums):
	res = []
	for k in nums:
		i = bisect.bisect_left(res, k)
		if i == len(res):
			res.append(k)
		else:
			res[i] = k
	return len(res)

def RP(nums):
	n = len(nums)
	s = set(nums)
	d = {}
	for (i, k) in enumerate(sorted(s), 1):
		d[k] = i
	bi = BIT([0] * (len(s) + 1))
	ans = 0
	for i in range(n - 1, -1, -1):
		ans += bi.query(d[nums[i]] - 1)
		bi.update(d[nums[i]], 1)
	return ans

class DLN:

	def __init__(self, val):
		self.val = val
		self.pre = None
		self.next = None

def nb(i, j, n, m):
	for (ni, nj) in [[i + 1, j], [i - 1, j], [i, j - 1], [i, j + 1]]:
		if 0 <= ni < n and 0 <= nj < m:
			yield (ni, nj)

def topo(n):
	q = deque()
	res = []
	for i in range(1, n + 1):
		if ind[i] == 0:
			q.append(i)
			res.append(i)
	while q:
		u = q.popleft()
		for v in g[u]:
			ind[v] -= 1
			if ind[v] == 0:
				q.append(v)
				res.append(v)
	return res

@bootstrap
def gdfs(r, p):
	if len(g[r]) == 1 and p != -1:
		yield None
	for ch in g[r]:
		if ch != p:
			yield gdfs(ch, r)
	yield None
t = N()
for i in range(t):
	n = N()
	x = A(n)
	y = A(n)
	for i in range(n):
		(x[i], y[i]) = RL()
	x.sort()
	y.sort()
	if len(x) & 1:
		ans = 1
	else:
		m = len(x)
		ans = x[m // 2] - x[m // 2 - 1] + 1
	if not len(y) & 1:
		m = len(y)
		ans *= y[m // 2] - y[m // 2 - 1] + 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	x = 0
	y = 0
	x2 = []
	y2 = []
	for i in range(n):
		(x1, y1) = map(int, input().split())
		x2.append(x1)
		y2.append(y1)
	ans1 = 1
	ans2 = 1
	x2.sort()
	y2.sort()
	ans1 = x2[n // 2] - x2[n // 2 - 1] + 1
	ans2 = y2[n // 2] - y2[n // 2 - 1] + 1
	if n % 2 != 0:
		print(1)
	else:
		print(ans1 * ans2)


def median(x):
	x.sort()
	if len(x) % 2 == 1:
		return 1
	else:
		return x[len(x) // 2] - x[(len(x) - 1) // 2] + 1
for _ in range(int(input())):
	x = int(input())
	x1 = []
	y1 = []
	for i in range(x):
		(a, b) = map(int, input().split())
		x1.append(a)
		y1.append(b)
	ans1 = median(x1)
	ans2 = median(y1)
	print(ans1 * ans2)


def solve(n, X, Y):
	if n % 2 != 0:
		return 1
	X.sort()
	Y.sort()
	return (X[n // 2] - X[n // 2 - 1] + 1) * (Y[n // 2] - Y[n // 2 - 1] + 1)
t = int(input())
for _ in range(t):
	n = int(input())
	X = []
	Y = []
	for i in range(n):
		(x, y) = map(int, input().split())
		X.append(x)
		Y.append(y)
	print(solve(n, X, Y))


t = int(input())
for i in range(t):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		temps = input().split()
		x.append(int(temps[0]))
		y.append(int(temps[1]))
	x.sort()
	y.sort()
	if n % 2 != 0:
		print(1)
	else:
		print((x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1))


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(a, b) = list(map(int, input().split()))
		x.append(a)
		y.append(b)
	if n % 2:
		print(1)
	else:
		x.sort()
		y.sort()
		c = x[n // 2 - 1]
		d = x[n // 2]
		e = y[n // 2 - 1]
		f = y[n // 2]
		print((d - c + 1) * (f - e + 1))


for rpt in range(int(input())):
	house_count = int(input())
	houses = [[int(x) for x in input().split()] for y in range(house_count)]
	x_variants = 0
	y_variants = 0
	if house_count % 2 == 1:
		x_variants = 1
		y_variants = 1
	else:
		houses.sort()
		x_variants = houses[house_count // 2][0] - houses[house_count // 2 - 1][0] + 1
		houses.sort(key=lambda house: house[1])
		y_variants = houses[house_count // 2][1] - houses[house_count // 2 - 1][1] + 1
	print(x_variants * y_variants)


t = int(input())
for j in range(0, t):
	n = int(input())
	points = []
	for i in range(0, n):
		l = [int(x) for x in input().split()]
		points.append([l[0], l[1]])
	x = []
	y = []
	for i in points:
		x.append(i[0])
		y.append(i[1])
	x.sort()
	y.sort()
	length = len(x)
	if length % 2 == 0:
		median2x = x[length // 2]
		median1x = x[length // 2 - 1]
		val1 = median2x - median1x - 1 + 2
		median2y = y[length // 2]
		median1y = y[length // 2 - 1]
		val2 = median2y - median1y - 1 + 2
		ans = val2 * val1
	else:
		ans = 1
	print(ans)


for i in range(int(input())):
	n = int(input())
	X = []
	Y = []
	for i in range(n):
		(x, y) = map(int, input().split())
		X.append(x)
		Y.append(y)
	X.sort()
	Y.sort()
	if n % 2 != 0:
		print(1)
	else:
		a = X[int(n / 2)] - X[int(n / 2) - 1] + 1
		b = Y[int(n / 2)] - Y[int(n / 2) - 1] + 1
		print(a * b)


t = int(input())
for _ in range(t):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	x.sort()
	y.sort()
	if n % 2 == 1:
		print(1)
	else:
		x1 = x[n // 2]
		x2 = x[n // 2 - 1]
		y1 = y[n // 2]
		y2 = y[n // 2 - 1]
		print((abs(x2 - x1) + 1) * (abs(y2 - y1) + 1))


t = int(input())
for case in range(t):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(a, b) = [int(j) for j in input().split()]
		x.append(a)
		y.append(b)
	res = 1
	if n % 2 == 1:
		print(res)
	else:
		x.sort()
		y.sort()
		ind1 = n // 2 - 1
		ind2 = n // 2
		numx = x[ind2] - x[ind1] + 1
		numy = y[ind2] - y[ind1] + 1
		res = numx * numy
		print(res)


def solve(arr):
	arr.sort()
	return arr[len(arr) // 2] - arr[(len(arr) - 1) // 2] + 1
t = int(input())
while t:
	t -= 1
	n = int(input())
	X = []
	Y = []
	for i in range(n):
		(x, y) = map(int, input().split())
		X.append(x)
		Y.append(y)
	print(solve(X) * solve(Y))


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(c, d) = map(int, input().split())
		x.append(c)
		y.append(d)
	x.sort()
	y.sort()
	if n & 1:
		print(1)
	else:
		c = int(n / 2)
		print((x[c] - x[c - 1] + 1) * (y[c] - y[c - 1] + 1))


t = int(input())
for i in range(t):
	xx = []
	yy = []
	n = int(input())
	for j in range(n):
		(x, y) = map(int, input().split())
		xx.append(x)
		yy.append(y)
	xx.sort()
	yy.sort()
	c = 0
	d = 0
	if n % 2 == 0:
		c = xx[n // 2] - xx[(n - 1) // 2] + 1
		d = yy[n // 2] - yy[(n - 1) // 2] + 1
		print(c * d)
	else:
		print(1)


from sys import stdin, stdout
(input, print) = (stdin.readline, stdout.write)

def main():
	for _ in range(int(input())):
		n = int(input())
		X = []
		Y = []
		for i in range(n):
			(x, y) = map(int, input().split())
			X.append(x)
			Y.append(y)
		if n % 2 == 1:
			print(str(1) + '\n')
		else:
			X.sort()
			Y.sort()
			print(str(abs(X[n // 2] - X[n // 2 - 1] + 1) * abs(Y[n // 2] - Y[n // 2 - 1] + 1)) + '\n')
main()


t = int(input())
for case in range(t):
	n = int(input())
	hx = []
	hy = []
	for _ in range(n):
		(xi, yi) = map(int, input().split())
		hx.append(xi)
		hy.append(yi)
	if n % 2:
		print(1)
	else:
		hx.sort()
		hy.sort()
		p = 1
		p *= hx[n // 2] - hx[n // 2 - 1] + 1
		p *= hy[n // 2] - hy[n // 2 - 1] + 1
		print(p)


for _ in range(int(input())):
	n = int(input())
	a = [map(int, input().split()) for _ in range(n)]
	(x, y) = map(sorted, zip(*a))
	if n % 2:
		print(1)
	else:
		k = n // 2
		print((x[k] - x[k - 1] + 1) * (y[k] - y[k - 1] + 1))


from operator import itemgetter
t = int(input())
for _ in range(t):
	n = int(input())
	houses = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		houses.append((x, y))
	houses_amounts_along_x = {}
	for (x, y) in sorted(houses):
		houses_amounts_along_x[x] = len(tuple(filter(lambda h: h[0] == x, houses)))
	houses_amounts_along_x = sorted(houses_amounts_along_x.items())
	possible_x_amount = 1
	min_total_x_distance = 0
	for (xi, amount) in houses_amounts_along_x:
		total_distance = 0
		for (xj, amount) in houses_amounts_along_x:
			distance = abs(xi - xj)
			total_distance += distance * amount
		if xi == houses_amounts_along_x[0][0]:
			min_total_x_distance = total_distance
			left_median = xi
		elif total_distance < min_total_x_distance:
			min_total_x_distance = total_distance
			possible_x_amount = 1
			left_median = xi
		elif total_distance == min_total_x_distance:
			right_median = xi
			possible_x_amount += right_median - left_median or 1
	houses_amounts_along_y = {}
	for (x, y) in sorted(houses, key=itemgetter(1)):
		houses_amounts_along_y[y] = len(tuple(filter(lambda h: h[1] == y, houses)))
	houses_amounts_along_y = sorted(houses_amounts_along_y.items())
	possible_y_amount = 1
	min_total_y_distance = 0
	for (yi, amount) in houses_amounts_along_y:
		total_distance = 0
		for (yj, amount) in houses_amounts_along_y:
			distance = abs(yi - yj)
			total_distance += distance * amount
		if yi == houses_amounts_along_y[0][0]:
			min_total_y_distance = total_distance
			left_median = yi
		elif total_distance < min_total_y_distance:
			min_total_y_distance = total_distance
			possible_y_amount = 1
			left_median = yi
		elif total_distance == min_total_y_distance:
			right_median = yi
			possible_y_amount += right_median - left_median or 1
	print(possible_x_amount * possible_y_amount)


def solve(n, point):
	for i in range(2):
		point[i].sort()
	res = []
	for i in range(2):
		if n % 2 == 0:
			res.append((point[i][(n - 1) // 2], point[i][n // 2]))
		else:
			res.append(point[i][n // 2])
	if n % 2 == 0:
		ans = (abs(res[0][0] - res[0][1]) + 1) * (abs(res[1][0] - res[1][1]) + 1)
	else:
		ans = 1
	return ans
t = int(input())
while t:
	n = int(input())
	point = [[], []]
	for i in range(n):
		(x, y) = map(int, input().split())
		point[0].append(x)
		point[1].append(y)
	print(solve(n, point))
	t -= 1


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	x = [0] * n
	y = [0] * n
	for i in range(n):
		(x[i], y[i]) = map(int, input().split())
	x.sort()
	y.sort()
	dx = x[n // 2] - x[(n - 1) // 2] + 1
	dy = y[n // 2] - y[(n - 1) // 2] + 1
	print(dx * dy)


def manh(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append((x, y))
	if n == 1:
		ans.append(1)
		continue
	a.sort(key=lambda e: e[0])
	if n % 2 == 0:
		cx = a[(n - 1) // 2 + 1][0] - a[(n - 1) // 2][0] + 1
	else:
		cx = 1
	a.sort(key=lambda e: e[1])
	if n % 2 == 0:
		cy = a[(n - 1) // 2 + 1][1] - a[(n - 1) // 2][1] + 1
	else:
		cy = 1
	ans.append(cx * cy)
for i in ans:
	print(i)


t = int(input())
for __ in range(t):
	n = int(input())
	xarr = []
	yarr = []
	for i in range(n):
		(x, y) = map(int, input().split(' '))
		xarr.append(x)
		yarr.append(y)
	if n % 2:
		print(1)
	else:
		xarr.sort()
		yarr.sort()
		(min_x, max_x) = (xarr[n // 2 - 1], xarr[n // 2])
		(min_y, max_y) = (yarr[n // 2 - 1], yarr[n // 2])
		print((max_x - min_x + 1) * (max_y - min_y + 1))


read = lambda : map(int, input().split())
t = int(input())
for _ in range(t):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(xx, yy) = read()
		x.append(xx)
		y.append(yy)
	x.sort()
	y.sort()
	if n % 2 == 0:
		m = n // 2
		ans = (x[m] - x[m - 1] + 1) * (y[m] - y[m - 1] + 1)
	else:
		ans = 1
	print(ans)


def solve():
	n = int(input())
	(x, y) = ([], [])
	for _ in range(n):
		(xi, yi) = list(map(int, input().split()))
		x.append(xi)
		y.append(yi)
	(x, y) = (sorted(x), sorted(y))
	return (x[n // 2] - x[(n - 1) // 2] + 1) * (y[n // 2] - y[(n - 1) // 2] + 1)
t = int(input())
for _ in range(t):
	print(solve())


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=2 ** 51, func=lambda a, b: a & b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for ik in range(int(input())):
	n = int(input())
	l = []
	l1 = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append(a)
		l1.append(b)
	l.sort()
	l1.sort()
	if len(l) % 2 == 1:
		w = 1
	else:
		w = l[len(l) // 2] - l[len(l) // 2 - 1] + 1
	if len(l1) % 2 == 1:
		w1 = 1
	else:
		w1 = l1[len(l1) // 2] - l1[len(l1) // 2 - 1] + 1
	print(w * w1)


T = int(input())
for t in range(T):
	n = int(input())
	(x, y) = ([], [])
	(d, e) = (0, 0)
	for i in range(n):
		(X, Y) = map(int, input().split())
		x.append(X)
		y.append(Y)
	x.sort()
	y.sort()
	if len(x) % 2 == 0:
		d = x[n // 2] - x[n // 2 - 1] + 1
	else:
		d = 1
	if len(y) % 2 == 0:
		e = y[n // 2] - y[n // 2 - 1] + 1
	else:
		e = 1
	print(d * e)


for tt in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(dx, dy) = map(int, input().split())
		x.append(dx)
		y.append(dy)
	x.sort()
	y.sort()
	if n % 2 == 0:
		print((x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1))
	else:
		print(1)


T = int(input())
for t in range(T):
	n = int(input())
	xx = []
	yy = []
	for i in range(n):
		(x, y) = tuple([int(x) for x in input().split()])
		xx.append(x)
		yy.append(y)
	xx = sorted(xx)
	yy = sorted(yy)
	range_x = 1
	range_y = 1
	if len(xx) % 2 == 0:
		range_x = xx[len(xx) // 2] - xx[len(xx) // 2 - 1] + 1
	if len(yy) % 2 == 0:
		range_y = yy[len(yy) // 2] - yy[len(yy) // 2 - 1] + 1
	print(range_x * range_y)


t = int(input())
while t:
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	x = sorted(x)
	y = sorted(y)
	if n % 2 == 1:
		print(1)
	else:
		ans = (x[n // 2] - x[n // 2 - 1] + 1) * (y[n // 2] - y[n // 2 - 1] + 1)
		print(ans)
	t = t - 1


t = int(input())
for _ in range(t):
	n = int(input())
	xs = []
	ys = []
	for _ in range(n):
		(x, y) = tuple(map(int, input().split()))
		(xs.append(x), ys.append(y))
	xs = sorted(xs)
	ys = sorted(ys)
	if n % 2 == 0:
		f_x = xs[n // 2] - xs[n // 2 - 1] + 1
	else:
		f_x = 1
	if n % 2 == 0:
		f_y = ys[n // 2] - ys[n // 2 - 1] + 1
	else:
		f_y = 1
	print(f_x * f_y)


def main():
	t = int(input())
	allans = []
	for _ in range(t):
		n = int(input())
		xes = []
		yes = []
		for _ in range(n):
			(x, y) = readIntArr()
			xes.append(x)
			yes.append(y)
		xes.sort()
		yes.sort()
		if n % 2 == 1:
			ans = 1
		elif n == 1:
			ans = 1
		else:
			x1 = xes[n // 2 - 1]
			x2 = xes[n // 2]
			mx = x2 - x1 + 1
			y1 = yes[n // 2 - 1]
			y2 = yes[n // 2]
			my = y2 - y1 + 1
			ans = mx * my
		allans.append(ans)
	multiLineArrayPrint(allans)
	return
import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]
inf = float('inf')
MOD = 10 ** 9 + 7
main()


def solve(X, Y, n):
	X = sorted(X)
	Y = sorted(Y)
	if n % 2 == 1:
		return 1
	else:
		return (X[n // 2] - X[n // 2 - 1] + 1) * (Y[n // 2] - Y[n // 2 - 1] + 1)
t = int(input())
for tc in range(t):
	n = int(input())
	X = []
	Y = []
	for i in range(n):
		(x, y) = map(int, input().split())
		X.append(x)
		Y.append(y)
	result = solve(X, Y, n)
	print(result)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
import time
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def isInt(s):
	return '0' <= s[0] <= '9'
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	X = []
	Y = []
	for n in range(N):
		(x, y) = getInts()
		X.append(x)
		Y.append(y)
	if N % 2 == 1:
		return 1
	X.sort()
	Y.sort()
	r = X[N // 2] - X[N // 2 - 1] + 1
	c = Y[N // 2] - Y[N // 2 - 1] + 1
	return r * c
for _ in range(getInt()):
	print(solve())