Antenna

Time limit5sMemory limit32 MB

Summary
Find the minimum enclosing circle radius squared, as an exact fraction, for the smallest circle covering at least K of N given points.
Level

Hard8 of 10

Topics
Geometry, Binary search, Brute force
Solved
No attempts yet

Problem

A telecommunications company is building a wireless network in a city. To satisfy its contract, the signal must reach at least KK of the city's households. Because the cost grows with the antenna's range, the company wants to place a single antenna so that the range needed to cover at least KK households is as small as possible.

There are NN households, each at integer coordinates. The antenna may be placed at any point of the plane (its coordinates need not be integers), and its range may be any positive real number RR. A household is covered when its Euclidean distance to the antenna is at most RR.

Given the households and the integer KK, determine the smallest range RR that lets a single antenna cover at least KK households.

Input

The first line contains two integers NN and KK (2≤K≤N≤5002 \le K \le N \le 500) — the number of households and the minimum number that must be covered.

Each of the next NN lines contains two integers XX and YY (0≤X,Y≤10 0000 \le X, Y \le 10\,000) — the coordinates of one household. No two households share the same coordinates.

Output

Let RR be the smallest range that allows at least KK households to be covered. The value R2R^2 is always rational, because the optimal circle is fixed either by two households lying on a diameter or by three households lying on its boundary.

Output R2R^2 as an irreducible fraction in the form p/q, where pp and qq are integers, q≥1q \ge 1, and gcd⁡(p,q)=1\gcd(p, q) = 1. Always print the denominator explicitly (for example, write 5/1 when R2=5R^2 = 5).

Note

The figures below illustrate how a single circle of the minimum range covers the required households.

Examples6

  1. Example 1

    Input
    4 3
    2 2
    6 2
    6 5
    2 8
    
    Expected output
    25/4
    
  2. Example 2

    Input
    10 5
    1 8
    2 6
    4 8
    2 2
    9 7
    8 5
    5 3
    3 3
    4 6
    4 1
    
    Expected output
    5/1
    
  3. Example 3

    Input
    2 2
    0 0
    0 4
    
    Expected output
    4/1
    
  4. Example 4

    Input
    3 3
    0 0
    4 0
    0 3
    
    Expected output
    25/4
    
  5. Example 5

    Input
    3 3
    0 0
    4 0
    2 3
    
    Expected output
    169/36
    
  6. Example 6

    Input
    5 3
    0 0
    1 0
    2 0
    3 0
    10 0
    
    Expected output
    1/1