QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 512 MB Points totaux : 100

#3355. 守卫边境

Statistiques

作为新任命的安全主管,你决定是时候升级边境防御了。由于有传言称一些邻国正在研制核武器,因此需要增加一些额外的弓箭塔。为了在敌方接近时能及时发现,你希望最小化相邻塔之间的最大距离。

边境被建模为从 $0$ 到 $L$ 的循环直线,上面放置了 $N$ 座(旧)塔。该国是一个内陆国家,因此第一座塔和最后一座塔也是相邻的(将点 $0$ 和 $L$ 视为同一点)。你有足够的资金在边境沿线额外放置最多 $M$ 座新塔。请找出放置后相邻塔之间最大距离的最小值。

输入格式

输入的第一行包含一个整数 $T$,表示测试用例的数量。接下来是 $T$ 行,每行描述一个测试用例。每个测试用例以三个整数 $N$、$M$ 和 $L$ 开头。$N$ 是边境上已有的塔的数量,$M$ 是允许放置的新塔的最大数量,$L$ 是边境的长度。随后是 $N$ 个浮点数 $t_i$,描述当前塔的位置。

输出格式

对于每个测试用例,输出一行,包含一个数字,即放置后相邻塔之间最大距离的最小值。

数据范围

  • $0 < T \le 100$
  • $0 \le N \le 20000$
  • $0 < M \le 20000$
  • $0 < L \le 10000000$
  • $0 \le t_i < L$
  • 没有两座塔位于完全相同的位置。
  • 对于距离,允许与正确答案有最多 $10^{-7}$ 的绝对或相对误差。

样例

输入格式 1

2
0 3 15
2 1 1000 667.4 333.8

输出格式 1

5
333.6

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.