from itertools import combinations



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

points = []

for i in range(N):

    points.append(list(map(int, input().split())))



xl = list([p[0] for p in points])

yl = list([p[1] for p in points])



def contained(point, xmin, xmax, ymin, ymax):

    return (xmin <= point[0] <= xmax) and (ymin <= point[1] <= ymax)



def count_contained(xmin, xmax, ymin, ymax):

    count = 0

    for point in points:

        if contained(point, xmin, xmax, ymin, ymax):

            count += 1

    return count



min_area = 10**20

for xs in combinations(xl, 2):

    xmin = min(xs)

    xmax = max(xs)

    for ys in combinations(yl, 2):

        ymin = min(ys)

        ymax = max(ys)

        if count_contained(xmin, xmax, ymin, ymax) >= K:

            area = (xmax-xmin) * (ymax-ymin)

            min_area = min(area, min_area)

print(min_area)

from itertools import combinations



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

points = []

for i in range(N):

    points.append(list(map(int, input().split())))



points.sort(key=lambda p:p[0])





min_area = 10**20

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

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

        points_tmp = points[l:l+k]

        points_tmp.sort(key=lambda p:p[1])

        for m in range(0, k-K+1):

            points_selected = points_tmp[m: m+K]

            ymin = points_selected[0][1]

            ymax = points_selected[-1][1]

            points_selected.sort(key=lambda p:p[0])

            xmin = points_selected[0][0]

            xmax = points_selected[-1][0]

            area = (xmax-xmin) * (ymax-ymin)

            min_area = min(area, min_area)



print(min_area)

from itertools import combinations

N, K = list(map(int, input().split()))
points = []
for i in range(N):
    points.append(list(map(int, input().split())))
xl = list([p[0] for p in points])
yl = list([p[1] for p in points])


def contained(point, xmin, xmax, ymin, ymax):
    return (xmin <= point[0] <= xmax) and (ymin <= point[1] <= ymax)


def count_contained(xmin, xmax, ymin, ymax):
    count = 0
    for point in points:
        if contained(point, xmin, xmax, ymin, ymax):
            count += 1
    return count


min_area = 10**20
for xs in combinations(xl, 2):
    xmin = min(xs)
    xmax = max(xs)
    for ys in combinations(yl, 2):
        ymin = min(ys)
        ymax = max(ys)
        if count_contained(xmin, xmax, ymin, ymax) >= K:
            area = (xmax - xmin) * (ymax - ymin)
            min_area = min(area, min_area)
print(min_area)

from itertools import combinations

N, K = list(map(int, input().split()))
points = []
for i in range(N):
    points.append(list(map(int, input().split())))
points.sort(key=lambda p: p[0])
min_area = 10**20
for k in range(K, N + 1):
    for l in range(0, N - k + 1):
        points_tmp = points[l : l + k]
        points_tmp.sort(key=lambda p: p[1])
        for m in range(0, k - K + 1):
            points_selected = points_tmp[m : m + K]
            ymin = points_selected[0][1]
            ymax = points_selected[-1][1]
            points_selected.sort(key=lambda p: p[0])
            xmin = points_selected[0][0]
            xmax = points_selected[-1][0]
            area = (xmax - xmin) * (ymax - ymin)
            min_area = min(area, min_area)
print(min_area)

-xl = list([p[0] for p in points]) -yl = list([p[1] for p in points]) - - -def contained(point, xmin, xmax, ymin, ymax): -    return (xmin <= point[0] <= xmax) and (ymin <= point[1] <= ymax) - - -def count_contained(xmin, xmax, ymin, ymax): -    count = 0 -    for point in points: -        if contained(point, xmin, xmax, ymin, ymax): -            count += 1 -    return count - - +points.sort(key=lambda p: p[0]) -for xs in combinations(xl, 2): -    xmin = min(xs) -    xmax = max(xs) -    for ys in combinations(yl, 2): -        ymin = min(ys) -        ymax = max(ys) -        if count_contained(xmin, xmax, ymin, ymax) >= K: +for k in range(K, N + 1): +    for l in range(0, N - k + 1): +        points_tmp = points[l : l + k] +        points_tmp.sort(key=lambda p: p[1]) +        for m in range(0, k - K + 1): +            points_selected = points_tmp[m : m + K] +            ymin = points_selected[0][1] +            ymax = points_selected[-1][1] +            points_selected.sort(key=lambda p: p[0]) +            xmin = points_selected[0][0] +            xmax = points_selected[-1][0]