Artemis

No attempts yetTime limit2sMemory limit128 MB

Problem

Zeus gave Artemis, goddess of the wilderness, a rectangular plot of land to grow a forest. The left edge of the plot lies on the positive $y$-axis, the bottom edge on the positive $x$-axis, and the lower-left corner of the plot is the origin $(0, 0)$. Zeus told Artemis to plant trees only on integer coordinate points inside the plot.

Artemis likes the forest to look natural, so she planted the trees in such a way that the line connecting any two trees is never parallel to the $x$-axis or the $y$-axis. In other words, all trees have distinct $x$-coordinates and all trees have distinct $y$-coordinates.

From time to time Zeus asks Artemis to cut down trees for him. The trees must be cut according to the following rules:

  1. At least $T$ trees, the number Zeus requires, are cut.
  2. To build a future football pitch, Artemis cuts every tree inside a single rectangular region and no tree outside of it.
  3. The sides of this rectangle are parallel to the $x$-axis and the $y$-axis.
  4. Two opposite corners of the rectangle must lie on trees, and those two corner trees are cut as well.

Because Artemis loves the trees, she wants to satisfy these conditions while cutting as few trees as possible. Since there may be several ways to pick the pair of trees that serve as the two opposite corners, report the minimum number of trees that Artemis must cut.

Input

The first line contains the number of trees in the forest, $N$. The second line contains $T$, the minimum number of trees that must be cut. Each of the following $N$ lines describes one tree with two space-separated integers $X$ and $Y$: the $x$-coordinate and the $y$-coordinate of that tree.

Output

Print, on a single line, the minimum number of trees that Artemis must cut. That is, among all axis-parallel rectangles whose two opposite corners both lie on trees and that contain at least $T$ trees (corners included), print the smallest number of trees any such rectangle contains.

Constraints

  • $1 < N \le 20000$
  • $0 \le X, Y \le 64000$
  • $1 < T \le N$
  • All trees have distinct $x$-coordinates and all trees have distinct $y$-coordinates.
  • It is guaranteed that at least one valid rectangle exists.