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

x = [0] * N

y = [0] * N

for i in range(N):

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

ans = float('inf')

for x1 in x:

    for x2 in x:

        if x1 > x2:

            continue

        for y1 in y:

            for y2 in y:

                if y1 > y2:

                    continue

                area = (x2 - x1) * (y2 - y1)

                if area >= ans:

                    continue

                cnt = 0

                for i in range(N):

                    if x1 <= x[i] <= x2 and y1 <= y[i] <= y2:

                        cnt += 1

                if cnt >= K:

                    ans = area

print(ans)

from itertools import accumulate, combinations



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

X = [0] * N

Y = [0] * N

for i in range(N):

    X[i], Y[i] = list(map(int, input().split()))

cx_to_x = sorted(list(set(X)))

x_to_cx = {k : i for i, k in enumerate(cx_to_x)}

cy_to_y = sorted(list(set(Y)))

y_to_cy = {k : i for i, k in enumerate(cy_to_y)}

nx = len(cx_to_x)

ny = len(cy_to_y)

points = [[0] * nx for _ in range(ny)]

for x, y in zip(X, Y):

    points[y_to_cy[y]][x_to_cx[x]] += 1

cum = [[0] * (nx+1)] + [list(accumulate([0] + row)) for row in points]

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

    for j in range(nx+1):

        cum[i][j] += cum[i-1][j]

ans = float('inf')

for x1, x2 in combinations(list(range(nx)), 2):

    for y1, y2 in combinations(list(range(ny)), 2):

        cnt = cum[y2+1][x2+1] - cum[y2+1][x1] - cum[y1][x2+1] + cum[y1][x1]

        if cnt >= K:

            area = (cx_to_x[x2] - cx_to_x[x1]) * (cy_to_y[y2] - cy_to_y[y1])

            ans = min(ans, area)

print(ans)
N, K = list(map(int, input().split()))
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = list(map(int, input().split()))
ans = float("inf")
for x1 in x:
    for x2 in x:
        if x1 > x2:
            continue
        for y1 in y:
            for y2 in y:
                if y1 > y2:
                    continue
                area = (x2 - x1) * (y2 - y1)
                if area >= ans:
                    continue
                cnt = 0
                for i in range(N):
                    if x1 <= x[i] <= x2 and y1 <= y[i] <= y2:
                        cnt += 1
                if cnt >= K:
                    ans = area
print(ans)

from itertools import accumulate, combinations

N, K = list(map(int, input().split()))
X = [0] * N
Y = [0] * N
for i in range(N):
    X[i], Y[i] = list(map(int, input().split()))
cx_to_x = sorted(list(set(X)))
x_to_cx = {k: i for i, k in enumerate(cx_to_x)}
cy_to_y = sorted(list(set(Y)))
y_to_cy = {k: i for i, k in enumerate(cy_to_y)}
nx = len(cx_to_x)
ny = len(cy_to_y)
points = [[0] * nx for _ in range(ny)]
for x, y in zip(X, Y):
    points[y_to_cy[y]][x_to_cx[x]] += 1
cum = [[0] * (nx + 1)] + [list(accumulate([0] + row)) for row in points]
for i in range(1, ny + 1):
    for j in range(nx + 1):
        cum[i][j] += cum[i - 1][j]
ans = float("inf")
for x1, x2 in combinations(list(range(nx)), 2):
    for y1, y2 in combinations(list(range(ny)), 2):
        cnt = cum[y2 + 1][x2 + 1] - cum[y2 + 1][x1] - cum[y1][x2 + 1] + cum[y1][x1]
        if cnt >= K:
            area = (cx_to_x[x2] - cx_to_x[x1]) * (cy_to_y[y2] - cy_to_y[y1])
            ans = min(ans, area)
print(ans)

+from itertools import accumulate, combinations + -x = [0] * N -y = [0] * N +X = [0] * N +Y = [0] * N -    x[i], y[i] = list(map(int, input().split())) +    X[i], Y[i] = list(map(int, input().split())) +cx_to_x = sorted(list(set(X))) +x_to_cx = {k: i for i, k in enumerate(cx_to_x)} +cy_to_y = sorted(list(set(Y))) +y_to_cy = {k: i for i, k in enumerate(cy_to_y)} +nx = len(cx_to_x) +ny = len(cy_to_y) +points = [[0] * nx for _ in range(ny)] +for x, y in zip(X, Y): +    points[y_to_cy[y]][x_to_cx[x]] += 1 +cum = [[0] * (nx + 1)] + [list(accumulate([0] + row)) for row in points] +for i in range(1, ny + 1): +    for j in range(nx + 1): +        cum[i][j] += cum[i - 1][j] -for x1 in x: -    for x2 in x: -        if x1 > x2: -            continue -        for y1 in y: -            for y2 in y: -                if y1 > y2: -                    continue -                area = (x2 - x1) * (y2 - y1) -                if area >= ans: -                    continue -                cnt = 0 -                for i in range(N): -                    if x1 <= x[i] <= x2 and y1 <= y[i] <= y2: -                        cnt += 1 -                if cnt >= K: -                    ans = area +for x1, x2 in combinations(list(range(nx)), 2): +    for y1, y2 in combinations(list(range(ny)), 2): +        cnt = cum[y2 + 1][x2 + 1] - cum[y2 + 1][x1] - cum[y1][x2 + 1] + cum[y1][x1] +        if cnt >= K: +            area = (cx_to_x[x2] - cx_to_x[x1]) * (cy_to_y[y2] - cy_to_y[y1]) +            ans = min(ans, area)