QOJ.ac

QOJ

시간 제한: 2.0 s 메모리 제한: 512 MB 총점: 100

#15802. 湖

통계

有一个周长为 $L$ 的湖,湖的边界上分布着 $n$ 个港口。港口从 $1$ 到 $n$ 进行编号。如果你从港口 $1$ 开始沿顺时针方向在边界上步行距离 $x_i$,你将到达港口 $i$。在湖边界上的任意两点之间移动有两种方式:

  • 沿湖的边界步行(顺时针或逆时针方向均可)。你的速度为每单位时间一个单位距离。
  • 乘船从一个港口移动到另一个港口。船的速度极快,因此你可以忽略这种方式所需的时间。

Snuke 决定在湖的边界上新增 $k$ 个港口。当 Snuke 选择最优的新港口位置时,计算最小可能的 $T$,使得在湖边界上的任意两点之间都可以在时间 $T$ 内完成旅行。

输入格式

输入的第一行包含三个整数 $L$,$n$ 和 $k$。接下来有 $n$ 行,其中第 $i$ 行包含一个整数 $x_i$。

数据范围

  • $1 \le L \le 10^9$
  • $2 \le n \le 10^5$
  • $1 \le k \le 10^9$
  • $0 = x_1 < x_2 < \dots < x_n < L$

输出格式

输出题目中描述的 $T$ 的最小可能值。你的输出的绝对误差或相对误差必须不超过 $10^{-6}$。

样例

输入样例 1

10 2 1
0
4

输出样例 1

3.500000000000

输入样例 2

100 10 1000
0
3
11
18
34
46
55
79
84
90

输出样例 2

0.099585062241

说明

对于第一个样例,在最优解中,新港口的位置应该在 $7$(从港口 $1$ 开始顺时针测量)。

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.