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

p,x,y=[],[],[]

z=float("inf")

for i in range(n):

  a,b=list(map(int,input().split()))

  p.append((a,b))

  x.append(a)

  y.append(b)

x.sort()

y.sort()

for i in range(n-1):

  for j in range(i,n):

    for k in range(n-1):

      lx,rx,dy=x[i],x[j],y[k]

      c=0

      t=[]

      for a,b in p:

        if x[i]<=a<=x[j] and y[k]<=b:c+=1;t.append(b)

      if h<=c:z=min(z,(x[j]-x[i])*(sorted(t)[h-1]-y[k]))

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

x=[]

y=[]

xy=[]

for _ in range(n):

  xx,yy=list(map(int,input().split()))

  xy.append((xx,yy))

  x.append(xx)

  y.append(yy)

xx=sorted(x)

yy=sorted(y)

ans=10**20

for sxi in range(n-1):

  for syi in range(n-1):

    for tyi in range(1,n):

      sx,sy,ty=xx[sxi],yy[syi],yy[tyi]

      ax=sorted([xxx for xxx,yyy in xy if sx<=xxx and sy<=yyy<=ty])

      if len(ax)<k:continue

      tx=ax[k-1]

      ans=min(ans,(tx-sx)*(ty-sy))

print(ans)
n, h = list(map(int, input().split()))
p, x, y = [], [], []
z = float("inf")
for i in range(n):
    a, b = list(map(int, input().split()))
    p.append((a, b))
    x.append(a)
    y.append(b)
x.sort()
y.sort()
for i in range(n - 1):
    for j in range(i, n):
        for k in range(n - 1):
            lx, rx, dy = x[i], x[j], y[k]
            c = 0
            t = []
            for a, b in p:
                if x[i] <= a <= x[j] and y[k] <= b:
                    c += 1
                    t.append(b)
            if h <= c:
                z = min(z, (x[j] - x[i]) * (sorted(t)[h - 1] - y[k]))
print(z)

n, k = list(map(int, input().split()))
x = []
y = []
xy = []
for _ in range(n):
    xx, yy = list(map(int, input().split()))
    xy.append((xx, yy))
    x.append(xx)
    y.append(yy)
xx = sorted(x)
yy = sorted(y)
ans = 10**20
for sxi in range(n - 1):
    for syi in range(n - 1):
        for tyi in range(1, n):
            sx, sy, ty = xx[sxi], yy[syi], yy[tyi]
            ax = sorted([xxx for xxx, yyy in xy if sx <= xxx and sy <= yyy <= ty])
            if len(ax) < k:
                continue
            tx = ax[k - 1]
            ans = min(ans, (tx - sx) * (ty - sy))
print(ans)

-n, h = list(map(int, input().split())) -p, x, y = [], [], [] -z = float("inf") -for i in range(n): -    a, b = list(map(int, input().split())) -    p.append((a, b)) -    x.append(a) -    y.append(b) -x.sort() -y.sort() -for i in range(n - 1): -    for j in range(i, n): -        for k in range(n - 1): -            lx, rx, dy = x[i], x[j], y[k] -            c = 0 -            t = [] -            for a, b in p: -                if x[i] <= a <= x[j] and y[k] <= b: -                    c += 1 -                    t.append(b) -            if h <= c: -                z = min(z, (x[j] - x[i]) * (sorted(t)[h - 1] - y[k])) -print(z) +n, k = list(map(int, input().split())) +x = [] +y = [] +xy = [] +for _ in range(n): +    xx, yy = list(map(int, input().split())) +    xy.append((xx, yy)) +    x.append(xx) +    y.append(yy) +xx = sorted(x) +yy = sorted(y) +ans = 10**20 +for sxi in range(n - 1): +    for syi in range(n - 1): +        for tyi in range(1, n): +            sx, sy, ty = xx[sxi], yy[syi], yy[tyi] +            ax = sorted([xxx for xxx, yyy in xy if sx <= xxx and sy <= yyy <= ty]) +            if len(ax) < k: +                continue +            tx = ax[k - 1] +            ans = min(ans, (tx - sx) * (ty - sy)) +print(ans)