Vanya and Lanterns

TimeLimit:1000ms  MemoryLimit:128000KB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description
Vanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the street corresponding to the point 0, and its end corresponding to the point l. Then the i-th lantern is at the point ai. The lantern lights all points of the street that are at the distance of at most d from it, where d is some positive number, common for all lanterns.
Vanya wonders: what is the minimum light radius d should the lanterns have to light the whole street?
Input
Input contains multiple test cases. The first line contains two integers n, l (1 ≤ n ≤ 1000, 1 ≤ l ≤ 10^9) — the number of lanterns and the length of the street respectively.
The next line contains n integers ai (0 ≤ ai ≤ l). Multiple lanterns can be located at the same point. The lanterns may be located at the ends of the street.
Output
For each group of input integers you should print the minimum light radius d, needed to light the whole street. Its fractional part should be represented by 2 decimal digits after the decimal point.
SampleInput
7 15
15 5 3 7 9 14 0
2 5
2 5
SampleOutput
2.50
2.00
Submit
题目统计信息详细
总AC数18
通过人数17
尝试人数20
总提交量32
AC率53.13%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: