import itertools



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

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

ans = float("INF")

for a, b in itertools.combinations(xy, 2):

    for c, d in itertools.combinations(xy, 2):

        x1, x2 = sorted([a[0], b[0]])

        y1, y2 = sorted([c[1], d[1]])

        count = 0

        for x, y in xy:

            if x1 <= x <= x2 and y1 <= y <= y2:

                count += 1

        if count >= k:

            ans = min(ans, (x2 - x1) * (y2 - y1))

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

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

ans = float("INF")

en = tuple(enumerate(xy))

for i, (a, b) in en[:n - k + 1]:

    for j, (c, d) in en[i + k - 1:]:

        r = sorted(y for x, y in xy[i:j + 1])

        r2 = r[k - 1:]

        for i2, j2 in zip(r, r2):

            if i2 <= b and d <= j2:

                ans = min(ans, (c - a) * (j2 - i2))

print(ans)
import itertools

n, k = list(map(int, input().split()))
xy = [tuple(map(int, input().split())) for i in range(n)]
ans = float("INF")
for a, b in itertools.combinations(xy, 2):
    for c, d in itertools.combinations(xy, 2):
        x1, x2 = sorted([a[0], b[0]])
        y1, y2 = sorted([c[1], d[1]])
        count = 0
        for x, y in xy:
            if x1 <= x <= x2 and y1 <= y <= y2:
                count += 1
        if count >= k:
            ans = min(ans, (x2 - x1) * (y2 - y1))
print(ans)

n, k = list(map(int, input().split()))
xy = sorted([tuple(map(int, input().split())) for i in range(n)])
ans = float("INF")
en = tuple(enumerate(xy))
for i, (a, b) in en[: n - k + 1]:
    for j, (c, d) in en[i + k - 1 :]:
        r = sorted(y for x, y in xy[i : j + 1])
        r2 = r[k - 1 :]
        for i2, j2 in zip(r, r2):
            if i2 <= b and d <= j2:
                ans = min(ans, (c - a) * (j2 - i2))
print(ans)

-import itertools - -xy = [tuple(map(int, input().split())) for i in range(n)] +xy = sorted([tuple(map(int, input().split())) for i in range(n)]) -for a, b in itertools.combinations(xy, 2): -    for c, d in itertools.combinations(xy, 2): -        x1, x2 = sorted([a[0], b[0]]) -        y1, y2 = sorted([c[1], d[1]]) -        count = 0 -        for x, y in xy: -            if x1 <= x <= x2 and y1 <= y <= y2: -                count += 1 -        if count >= k: -            ans = min(ans, (x2 - x1) * (y2 - y1)) +en = tuple(enumerate(xy)) +for i, (a, b) in en[: n - k + 1]: +    for j, (c, d) in en[i + k - 1 :]: +        r = sorted(y for x, y in xy[i : j + 1]) +        r2 = r[k - 1 :] +        for i2, j2 in zip(r, r2): +            if i2 <= b and d <= j2: +                ans = min(ans, (c - a) * (j2 - i2))