from collections import defaultdict



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

xy = [list(map(int, input().split())) for _ in range(N)]

INF = 10 ** 19



acc = defaultdict(int)



x = [-INF]

y = [-INF]



for ex, ey in xy:

	acc[(ex, ey)] = 1

	x.append(ex)

	y.append(ey)



x.sort()

y.sort()



for i in range(N):

	for j in range(N + 1):

		acc[(x[i+1], y[j])] += acc[(x[i], y[j])]



for j in range(N):

	for i in range(N + 1):

		acc[(x[i], y[j+1])] += acc[(x[i], y[j])]



ans = INF

for i in range(1, N + 1):

	for j in range(i + 1, N + 1):

		for k in range(1, N + 1):

			for l in range(k + 1, N + 1):

				cnt = acc[(x[j], y[l])] - acc[(x[j], y[k-1])] - acc[(x[i-1], y[l])] + acc[(x[i-1], y[k-1])]

				if cnt >= K:

					sq = (x[j] - x[i]) * (y[l] - y[k])

					ans = min(ans, sq)



print(ans)

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

xy = [list(map(int, input().split())) for _ in range(n)]

INF = 10 ** 19



xy.sort()



ans = INF

for i in range(n):

	for j in range(i + k - 1, n):

		width = xy[j][0] - xy[i][0]



		y = [xy[idx][1] for idx in range(i, j + 1)]

		y.sort()



		for e1, e2 in zip(y, y[k-1:]):

			height = e2 - e1

			area = width * height

			ans = min(ans, area)



print(ans)

from collections import defaultdict

N, K = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(N)]
INF = 10**19
acc = defaultdict(int)
x = [-INF]
y = [-INF]
for ex, ey in xy:
    acc[(ex, ey)] = 1
    x.append(ex)
    y.append(ey)
x.sort()
y.sort()
for i in range(N):
    for j in range(N + 1):
        acc[(x[i + 1], y[j])] += acc[(x[i], y[j])]
for j in range(N):
    for i in range(N + 1):
        acc[(x[i], y[j + 1])] += acc[(x[i], y[j])]
ans = INF
for i in range(1, N + 1):
    for j in range(i + 1, N + 1):
        for k in range(1, N + 1):
            for l in range(k + 1, N + 1):
                cnt = (
                    acc[(x[j], y[l])]
                    - acc[(x[j], y[k - 1])]
                    - acc[(x[i - 1], y[l])]
                    + acc[(x[i - 1], y[k - 1])]
                )
                if cnt >= K:
                    sq = (x[j] - x[i]) * (y[l] - y[k])
                    ans = min(ans, sq)
print(ans)

n, k = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(n)]
INF = 10**19
xy.sort()
ans = INF
for i in range(n):
    for j in range(i + k - 1, n):
        width = xy[j][0] - xy[i][0]
        y = [xy[idx][1] for idx in range(i, j + 1)]
        y.sort()
        for e1, e2 in zip(y, y[k - 1 :]):
            height = e2 - e1
            area = width * height
            ans = min(ans, area)
print(ans)

-from collections import defaultdict - -N, K = list(map(int, input().split())) -xy = [list(map(int, input().split())) for _ in range(N)] +n, k = list(map(int, input().split())) +xy = [list(map(int, input().split())) for _ in range(n)] -acc = defaultdict(int) -x = [-INF] -y = [-INF] -for ex, ey in xy: -    acc[(ex, ey)] = 1 -    x.append(ex) -    y.append(ey) -x.sort() -y.sort() -for i in range(N): -    for j in range(N + 1): -        acc[(x[i + 1], y[j])] += acc[(x[i], y[j])] -for j in range(N): -    for i in range(N + 1): -        acc[(x[i], y[j + 1])] += acc[(x[i], y[j])] +xy.sort() -for i in range(1, N + 1): -    for j in range(i + 1, N + 1): -        for k in range(1, N + 1): -            for l in range(k + 1, N + 1): -                cnt = ( -                    acc[(x[j], y[l])] -                    - acc[(x[j], y[k - 1])] -                    - acc[(x[i - 1], y[l])] -                    + acc[(x[i - 1], y[k - 1])] -                ) -                if cnt >= K: -                    sq = (x[j] - x[i]) * (y[l] - y[k]) -                    ans = min(ans, sq) +for i in range(n): +    for j in range(i + k - 1, n): +        width = xy[j][0] - xy[i][0] +        y = [xy[idx][1] for idx in range(i, j + 1)] +        y.sort() +        for e1, e2 in zip(y, y[k - 1 :]): +            height = e2 - e1 +            area = width * height +            ans = min(ans, area)