Under construction

Still being built. Things may change

Repair Depots

Interview

Time limit1sMemory limit128 MB

Summary
Place at most c depots anywhere in the plane to minimize the largest distance from any of n bots (n at most 16) to its nearest depot, and print that distance to six decimals.
Level

Hard8 of 10

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

Problem

RoboCorp Oregon has already deployed several of its PoliceBots across the state, and now they want to be able to repair a bot whenever it breaks. They will build only a limited number of repair depots, and they want to position those depots so that every bot is close to one of them.

You are given the locations of the nn deployed PoliceBots (1≤n≤161 \le n \le 16) and the maximum number of repair depots cc (1≤c≤n1 \le c \le n) that RoboCorp is willing to build. You may place each depot at any point in the plane (not only at a bot's location). Every bot is served by the depot nearest to it, and any bot can be repaired at any depot. Position at most cc depots so that the largest distance from any bot to its nearest depot is as small as possible, and report that minimum possible distance.

Input

The first line contains an integer tt (1≤t≤3501 \le t \le 350), the number of test cases.

Each test case begins with a line containing two integers nn and cc. The next nn lines each contain two space-separated real numbers xx and yy (0.0≤x,y≤10.00.0 \le x, y \le 10.0), the Cartesian coordinates of one bot. Coordinates are real values; some may be written as integers.

Output

For each test case, print on its own line the minimum achievable value of the maximum bot-to-nearest-depot distance. Print the value with at least one digit before the decimal point and exactly six digits after it. Your answer must be within 5×10−75\times10^{-7} of the true result; the true result will never have a 44 or a 55 as its seventh digit after the decimal point, so rounding to six places is unambiguous.

Examples3

  1. Example 1

    Input
    2
    9 3
    1 1
    1 2
    1 3
    2 1
    2 2
    2 3
    3 1
    3 2
    3 3
    4 2
    0 0
    1 1
    2 4
    3 9
    
    Expected output
    1.000000
    2.236068
    
  2. Example 2

    Input
    1
    1 1
    5.0 5.0
    
    Expected output
    0.000000
    
  3. Example 3

    Input
    1
    2 1
    0.0 0.0
    6.0 8.0
    
    Expected output
    5.000000