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: from itertools import groupby, accumulate, product, permutations, combinations
  
  
  def compress(arr):
      (*XS,) = set(arr)
      XS.sort()
      return {e: i + 1 for i, e in enumerate(XS)}, {i + 1: e for i, e in enumerate(XS)}
  
  
  def solve():
      ans = float("inf")
      N, K = map(int, input().split())
      X, Y = [0] * N, [0] * N
      for i in range(N):
          X[i], Y[i] = map(int, input().split())
      x_c, x_r = compress(X)
      y_c, y_r = compress(Y)
      n_x = len(x_c)
      n_y = len(y_c)
      num = [[0] * (N + 1) for _ in range(N + 1)]
      for i in range(N):
          X[i] = x_c[X[i]]
          Y[i] = y_c[Y[i]]
          num[X[i]][Y[i]] += 1
      cum2 = [[0] * (N + 1) for _ in range(N + 1)]
      for i in range(1, N + 1):
          for j in range(1, N + 1):
              cum2[i][j] = (
                  cum2[i - 1][j] + cum2[i][j - 1] - cum2[i - 1][j - 1] + num[i][j]
              )
      for x1, x2 in combinations(range(1, n_x + 1), 2):
          x_l = x_r[x2] - x_r[x1]
          for y1, y2 in combinations(range(1, n_y + 1), 2):
              k = (
                  cum2[x2][y2]
                  + cum2[x1 - 1][y1 - 1]
                  - cum2[x1 - 1][y2]
                  - cum2[x2][y1 - 1]
              )
              if k >= K:
                  y_l = y_r[y2] - y_r[y1]
                  ans = min(ans, x_l * y_l)
      return ans
  
  
  print(solve())
  
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."}]