United States of Eurasia

Split N points sorted by x into at most K contiguous groups, minimizing the largest squared diameter within any group.

Hard9Binary searchDynamic programmingDivide and conquerGeometryNo attempts yetTime limit20sMemory limit1024 MB

Problem

In the year 5013 an emperor conquered the continent of Eurasia and founded the United States of Eurasia. The country is wide enough to cover the whole continent and its population is large, so the emperor wants to split the territory into provinces and manage them efficiently. The country has NN houses, and house ii stands at (xi,yi)(x_i, y_i) in the two dimensional Euclidean plane. The emperor assigns the houses to provinces under the following conditions.

  • Condition 1. Each province manages the houses whose xx coordinate falls inside one interval. A province may manage every house, and a province may manage no house at all.
  • Condition 2. Every house must be managed by exactly one province.
  • Condition 3. At most KK provinces can be created.

Eurasia has many races, religions and peoples. To prevent conflicts among them, the division inside each province has to be as small as possible. The division of a province is the distance between the farthest pair of houses that the province manages. The distance is the Euclidean distance. Help the emperor and make the largest division among the provinces as small as possible.

Input

The first line contains the number of houses NN and the number of provinces KK, separated by a space.

Each of the next NN lines contains two integers xix_i and yiy_i separated by a space, which means that a house stands at (xi,yi)(x_i, y_i).

Output

Let MM be the largest division among the provinces when the houses are split so that this largest division is as small as possible. Print M2M^2. All coordinates are integers, so M2M^2 is always an integer.

Constraints

  • 1KN2500001 \le K \le N \le 250\,000
  • All house coordinates are distinct. That is, if iji \ne j, then xixjx_i \ne x_j or yiyjy_i \ne y_j holds.
  • 0xi,yi1090 \le x_i, y_i \le 10^9