output_description: Print the minimum possible area of a rectangle that satisfies the condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K  
      x_1 y_1
      :  
      x_{N} y_{N}
attempt: import math
  
  # import numpy as np
  import queue
  from collections import deque, defaultdict
  import heapq as hpq
  from sys import stdin, setrecursionlimit
  
  # from scipy.sparse.csgraph import dijkstra
  # from scipy.sparse import csr_matrix
  ipt = stdin.readline
  setrecursionlimit(10**7)
  
  
  def main():
      n, k = map(int, ipt().split())
      dx = dict()
      dy = dict()
      xs = []
      ys = []
      for _ in range(n):
          x, y = map(int, ipt().split())
          dx[x] = y
          dy[y] = x
          xs.append(x)
          ys.append(y)
      xs.sort()
      ys.sort()
      sm = [[0] * (n + 1) for i in range(n + 1)]
      f = False
      ly = dx[xs[n - 1]]
      for i, yi in enumerate(ys[::]):
          if f:
              sm[n - 1][i] = 0
          else:
              sm[n - 1][i] = 1
          if ly == yi:
              f = True
      for i, xi in enumerate(xs[n - 2 :: -1]):
          f = False
          smx = sm[n - i - 2]
          smpx = sm[n - i - 1]
          ly = dx[xi]
          for j, yj in enumerate(ys):
              if f:
                  smx[j] = smpx[j]
              else:
                  smx[j] = smpx[j] + 1
              if ly == yj:
                  f = True
      ma = 4 * 10**18 + 1
      for xl, xli in enumerate(xs[: n - 1 :]):
          smxl = sm[xl]
          for xr, xri in enumerate(xs[xl + 1 : :]):
              smxr = sm[xl + xr + 2]
              for yd, ydi in enumerate(ys[: n - 1 :]):
                  for yu, yui in enumerate(ys[yd + 1 : :]):
                      sk = smxl[yd] + smxr[yu + yd + 2] - smxl[yu + yd + 2] - smxr[yd]
                      if sk == k:
                          ss = (yui - ydi) * (xri - xli)
                          if ss < ma:
                              ma = ss
      print(ma)
  
      return
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  We have N points in a two-dimensional plane.  
  The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i).  
  Let us consider a rectangle whose sides are parallel to the coordinate axes
  that contains K or more of the N points in its interior.  
  Here, points on the sides of the rectangle are considered to be in the
  interior.  
  Find the minimum possible area of such a rectangle.
samples: [{"input": "4 4\n    1 4\n    3 3\n    6 2\n    8 1", "output": "21\n    \n\nOne rectangle that satisfies the condition with the minimum possible area has\nthe following vertices: (1,1), (8,1), (1,4) and (8,4).  \nIts area is (8-1) \u00d7 (4-1) = 21.\n\n* * *"}, {"input": "4 2\n    0 0\n    1 1\n    2 2\n    3 3", "output": "1\n    \n\n* * *"}, {"input": "4 3\n    -1000000000 -1000000000\n    1000000000 1000000000\n    -999999999 999999999\n    999999999 -999999999", "output": "3999999996000000001\n    \n\nWatch out for integer overflows."}]