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

sx, sy = [], []

for i in range(n):

    x, y = list(map(int, input().split()))

    sx.append((x, i))

    sy.append((y, i))

sx.sort()

sy.sort()

px = [[0] for _ in range(n)]

for cx, (x, i) in enumerate(sx):

    px[i] = cx



acm = [[0] * (n + 1) for _ in range(n + 1)]

for cy, (y, i) in enumerate(sy):

    for cx in range(n):

        acm[cx][cy] = acm[cx - 1][cy] + acm[cx][cy - 1] - acm[cx - 1][cy - 1] + int(px[i] == cx)



ans = 5e18

for lcx in range(n - k + 1):

    for lcy in range(n - k + 1):

        acm_l = acm[lcx - 1][lcy - 1]

        for ucx in range(lcx + k - 1, n):

            for ucy in range(lcy + k - 1, n):

                if acm[ucx][ucy] - acm[ucx][lcy - 1] - acm[lcx - 1][ucy] + acm_l >= k:

                    ans = min(ans, (sx[ucx][0] - sx[lcx][0]) * (sy[ucy][0] - sy[lcy][0]))

                    break

print(ans)

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

ps = [tuple(map(int, input().split())) for i in range(n)]

sx = sorted(ps)

nx = list(enumerate(sx))



ans = 5e18

for l, (x1, y1) in nx[:n - k + 1]:

    for r, (x2, y2) in nx[l + k - 1:]:

        dx = x2 - x1

        sy = sorted(y for x, y in sx[l:r + 1])

        for y3, y4 in zip(sy, sy[k - 1:]):

            if y3 <= y1 and y2 <= y4:

                ans = min(ans, dx * (y4 - y3))

print(ans)

n, k = list(map(int, input().split()))
sx, sy = [], []
for i in range(n):
    x, y = list(map(int, input().split()))
    sx.append((x, i))
    sy.append((y, i))
sx.sort()
sy.sort()
px = [[0] for _ in range(n)]
for cx, (x, i) in enumerate(sx):
    px[i] = cx
acm = [[0] * (n + 1) for _ in range(n + 1)]
for cy, (y, i) in enumerate(sy):
    for cx in range(n):
        acm[cx][cy] = (
            acm[cx - 1][cy] + acm[cx][cy - 1] - acm[cx - 1][cy - 1] + int(px[i] == cx)
        )
ans = 5e18
for lcx in range(n - k + 1):
    for lcy in range(n - k + 1):
        acm_l = acm[lcx - 1][lcy - 1]
        for ucx in range(lcx + k - 1, n):
            for ucy in range(lcy + k - 1, n):
                if acm[ucx][ucy] - acm[ucx][lcy - 1] - acm[lcx - 1][ucy] + acm_l >= k:
                    ans = min(
                        ans, (sx[ucx][0] - sx[lcx][0]) * (sy[ucy][0] - sy[lcy][0])
                    )
                    break
print(ans)

n, k = list(map(int, input().split()))
ps = [tuple(map(int, input().split())) for i in range(n)]
sx = sorted(ps)
nx = list(enumerate(sx))
ans = 5e18
for l, (x1, y1) in nx[: n - k + 1]:
    for r, (x2, y2) in nx[l + k - 1 :]:
        dx = x2 - x1
        sy = sorted(y for x, y in sx[l : r + 1])
        for y3, y4 in zip(sy, sy[k - 1 :]):
            if y3 <= y1 and y2 <= y4:
                ans = min(ans, dx * (y4 - y3))
print(ans)

-sx, sy = [], [] -for i in range(n): -    x, y = list(map(int, input().split())) -    sx.append((x, i)) -    sy.append((y, i)) -sx.sort() -sy.sort() -px = [[0] for _ in range(n)] -for cx, (x, i) in enumerate(sx): -    px[i] = cx -acm = [[0] * (n + 1) for _ in range(n + 1)] -for cy, (y, i) in enumerate(sy): -    for cx in range(n): -        acm[cx][cy] = ( -            acm[cx - 1][cy] + acm[cx][cy - 1] - acm[cx - 1][cy - 1] + int(px[i] == cx) -        ) +ps = [tuple(map(int, input().split())) for i in range(n)] +sx = sorted(ps) +nx = list(enumerate(sx)) -for lcx in range(n - k + 1): -    for lcy in range(n - k + 1): -        acm_l = acm[lcx - 1][lcy - 1] -        for ucx in range(lcx + k - 1, n): -            for ucy in range(lcy + k - 1, n): -                if acm[ucx][ucy] - acm[ucx][lcy - 1] - acm[lcx - 1][ucy] + acm_l >= k: -                    ans = min( -                        ans, (sx[ucx][0] - sx[lcx][0]) * (sy[ucy][0] - sy[lcy][0]) -                    ) -                    break +for l, (x1, y1) in nx[: n - k + 1]: +    for r, (x2, y2) in nx[l + k - 1 :]: +        dx = x2 - x1 +        sy = sorted(y for x, y in sx[l : r + 1]) +        for y3, y4 in zip(sy, sy[k - 1 :]): +            if y3 <= y1 and y2 <= y4: +                ans = min(ans, dx * (y4 - y3))