CF1641F.Covering Circle

NOI/NOI+/CTSC

通过率:0%

时间限制:6.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Sam started playing with round buckets in the sandbox, while also scattering pebbles. His mom decided to buy him a new bucket, so she needs to solve the following task.

You are given nn distinct points with integer coordinates A1,A2,…,AnA_1, A_2, \ldots, A_n. All points were generated from the square [−108,108]×[−108,108][-10^8, 10^8] \times [-10^8, 10^8] uniformly and independently.

You are given positive integers kk, ll, such that k≤l≤nk \leq l \leq n. You want to select a subsegment Ai,Ai+1,…,Ai+l−1A_i, A_{i+1}, \ldots, A_{i+l-1} of the points array (for some 1≤i≤n+1−l1 \leq i \leq n + 1 - l), and some circle on the plane, containing ≥k\geq k points of the selected subsegment (inside or on the border).

What is the smallest possible radius of that circle?

山姆在沙箱里玩圆形水桶,同时撒下了一些小石子。他的妈妈决定给他买一个新水桶,因此需要解决以下问题。

给定 nn 个互异的、具有整数坐标的点 A1,A2,…,AnA_1, A_2, \ldots, A_n。所有点均独立、均匀地从正方形区域 [−108,108]×[−108,108][-10^8, 10^8] \times [-10^8, 10^8] 中生成。

给定正整数 kk 和 ll,满足 k≤l≤nk \leq l \leq n。你需要从点列中选出一个长度为 ll 的连续子段 Ai,Ai+1,…,Ai+l−1A_i, A_{i+1}, \ldots, A_{i+l-1}(其中 1≤i≤n+1−l1 \leq i \leq n + 1 - l),并选取平面上的一个圆,使得该圆包含所选子段中至少 kk 个点(点可在圆内或圆上)。

该圆可能的最小半径是多少?

输入格式

Each test contains multiple test cases. The first line contains a single integer tt (1≤t≤1041 \leq t \leq 10^4) — the number of test cases. Descriptions of test cases follow.

The first line of each test case contains three integers nn, ll, kk (2≤k≤l≤n≤50 0002 \leq k \leq l \leq n \leq 50\,000, k≤20k \leq 20).

Each of the next nn lines contains two integers xix_i, yiy_i (−108≤xi,yi≤108-10^8 \leq x_i, y_i \leq 10^8) — the coordinates of the point AiA_i. It is guaranteed that all points are distinct and were generated independently from uniform distribution on [−108,108]×[−108,108][-10^8, 10^8] \times [-10^8, 10^8].

It is guaranteed that the sum of nn for all test cases does not exceed 50 00050\,000.

In the first test, points were not generated from the uniform distribution on [−108,108]×[−108,108][-10^8, 10^8] \times [-10^8, 10^8] for simplicity. It is the only such test and your solution must pass it.

Hacks are disabled in this problem.

每个测试包含多个测试用例。第一行包含一个整数 tt(1≤t≤1041 \leq t \leq 10^4),表示测试用例的数量。随后是各测试用例的描述。

每个测试用例的第一行包含三个整数 nn、ll、kk(2≤k≤l≤n≤50 0002 \leq k \leq l \leq n \leq 50\,000,且 k≤20k \leq 20)。

接下来的 nn 行中,每行包含两个整数 xix_i、yiy_i(−108≤xi,yi≤108-10^8 \leq x_i, y_i \leq 10^8),表示点 AiA_i 的坐标。保证所有点互不相同,且独立地从 [−108,108]×[−108,108][-10^8, 10^8] \times [-10^8, 10^8] 上的均匀分布中生成。

保证所有测试用例的 nn 值之和不超过 50 00050\,000。

在第一个测试用例中,为简化起见,点并非从 [−108,108]×[−108,108][-10^8, 10^8] \times [-10^8, 10^8] 上的均匀分布中生成。这是唯一一个这样的测试用例,你的解法必须通过它。

本题禁用 Hack。

输出格式

For each test case print a single real number — the answer to the problem.

Your answer will be considered correct if its absolute or relative error does not exceed 10−910^{-9}. Formally let your answer be aa, jury answer be bb. Your answer will be considered correct if ∣a−b∣max⁡(1,∣b∣)≤10−9\frac{|a - b|}{\max{(1, |b|)}} \le 10^{-9}.

对于每个测试用例,输出一个实数——该问题的答案。

若你的答案的绝对误差或相对误差不超过 10−910^{-9},则视为正确。形式化地,设你的答案为 aa,评测组的答案为 bb,当且仅当 ∣a−b∣max⁡(1,∣b∣)≤10−9\frac{|a - b|}{\max{(1, |b|)}} \le 10^{-9} 时,你的答案被视为正确。

输入输出样例

  • 输入#1

    4
    3 2 2
    0 0
    0 4
    3 0
    5 4 3
    1 1
    0 0
    2 2
    0 2
    2 0
    8 3 2
    0 3
    1 0
    0 2
    1 1
    0 1
    1 2
    0 0
    1 3
    5 4 4
    1 1
    -3 3
    2 2
    5 3
    5 5

    输出#1

    2.00000000000000000000
    1.00000000000000000000
    0.50000000000000000000
    4.00000000000000000000

说明/提示

In the first test case, we can select subsegment A1,A2A_1, A_2 and a circle with center (0,2)(0, 2) and radius 22.

In the second test case, we can select subsegment A1,A2,A3,A4A_1, A_2, A_3, A_4 and a circle with center (1,2)(1, 2) and radius 11.

在第一个测试用例中,我们可以选择子段 A1,A2A_1, A_2 以及以 (0,2)(0, 2) 为圆心、半径为 22 的圆。

在第二个测试用例中,我们可以选择子段 A1,A2,A3,A4A_1, A_2, A_3, A_4 以及以 (1,2)(1, 2) 为圆心、半径为 11 的圆。

输入解题思路,AI测评打分。不知道怎么写?

首页