Problem p02132 - Generation 1

Orig Description

Problem I: Explosion
Problem
Great Demon King Megumin plans to defeat $N$ heroes living on the ground.
Megumin can cast up to $M$ explosion spells.
The explosion magic is a spell that destroys heroes within a radius of $r$ centered on any coordinate.
The size of the hero can be ignored because they are very thin.
The radius of all $M$ explosion spells is assumed to be the same size.
It was decided to use magic with the minimum necessary radius to annihilate the heroes.
Minimize the size of the radius of the explosion magic.
Input
$N$ $M$
$x_1$ $y_1$
...
$x_N$ $y_N$
The input is given in the following format.
The number of heroes $N$ and the number of explosion spells $M$ are given as integers on the first line.
The coordinates $x_i$ $,$ $y_i$ of each hero $i$ are given as integers from the second line.
Constraints
The input satisfies the following conditions.
$1 \leq M \leq N \leq 14$
$0 \leq x_i $,$ y_i \leq 10^5$
Output
Output the minimum value of the radius of the explosion magic as a real number.
It must not include an absolute error exceeding $10^{-3}$.
Sample Input 1
5 2
0 0
5 5
10 10
100 100
200 200
Sample Output 1
70.710678118755
Sample Input 2
10 5
321 675
4312 6534
312 532
412 6543
21 43
654 321
543 0
32 5
41 76
5 1
Sample Output 2
169.824909833728
Sample Input 3
14 3
312 342
4893 432
321 4
389 4
23 543
0 0
1 1
2 2
432 12
435 32
1 5
2 10
100 100
20 50
Sample Output 3
218.087711712613
Sample Input 4
5 2
0 0
0 0
0 0
0 0
0 0
Sample Output 4
0.000000000001

Extracted Specification

Canonicalized Input Description:

An integer N (1 ≤ N ≤ 14), representing some quantity or size.
An integer M (1 ≤ M ≤ N), representing some quantity or size.
N pairs of integers (x, y) where each integer is between 0 and 100000.

### Example Input:

```
5 2
0 0
5 5
10 10
100 100
200 200
```

### Function Signature:

Write a function f(inputs) that takes in the input.

```python
def f(inputs: List[Tuple[int, int, List[Tuple[int, int]]]]):
    '''
    inputs: a list of tuples, where each tuple contains:
        - an integer N
        - an integer M
        - a list of N pairs of integers (x, y)
    '''
```

Test Case Generator

Sure! Here is a Python script that generates test cases for the given problem statement "Problem I: Explosion".

```python
import random

def generate_test_case():
    # Constraints
    N = random.randint(1, 14)
    M = random.randint(1, N)
    
    coordinates = []
    for _ in range(N):
        x = random.randint(0, 10**5)
        y = random.randint(0, 10**5)
        coordinates.append((x, y))
        
    return N, M, coordinates

def format_test_case(N, M, coordinates):
    test_case = []
    test_case.append(f"{N} {M}")
    for x, y in coordinates:
        test_case.append(f"{x} {y}")
    return "\n".join(test_case)

# Generate a test case
N, M, coordinates = generate_test_case()
test_case = format_test_case(N, M, coordinates)
print(test_case)
```

### Explanation:
1. **Constraints Handling:**
   - `N` is the number of heroes, chosen randomly between 1 and 14.
   - `M` is the number of explosion spells, chosen randomly between 1 and `N`.

2. **Coordinates Generation:**
   - For each hero, we generate random coordinates `(x, y)` where `0 ≤ x, y ≤ 10^5`.

3. **Formatting the Test Case:**
   - The first line contains `N` and `M`.
   - Each subsequent line contains the coordinates of a hero.

This script will generate randomized test cases that adhere to the constraints and format specified in the problem statement.

Extract Arguments

def extract_arguments(fh):
    N, M = map(int, fh.readline().strip().split())
    coordinates = [tuple(map(int, fh.readline().strip().split())) for _ in range(N)]
    return N, M, coordinates

# if __name__ == "__main__":
#     input_path = sys.argv[1]
#     with open(input_path, 'r') as fh: 
#     N, M, coordinates = extract_arguments(fh)
#     f(N, M, coordinates)