A8038 | Three Base Stations
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
The New Vasjuki village is stretched along the motorway and that's why every house on it is characterized by its shift relative to some fixed point — the $x_{i}$ coordinate. The village consists of $n$ houses, the $i$ -th house is located in the point with coordinates of $x_{i}$ .
TELE3, a cellular communication provider planned to locate three base stations so as to provide every house in the village with cellular communication. The base station having power $d$ located in the point $t$ provides with communication all the houses on the segment $[t-d,t+d]$ (including boundaries).
To simplify the integration (and simply not to mix anything up) all the three stations are planned to possess the equal power of $d$ . Which minimal value of $d$ is enough to provide all the houses in the village with cellular communication.
TELE3, a cellular communication provider planned to locate three base stations so as to provide every house in the village with cellular communication. The base station having power $d$ located in the point $t$ provides with communication all the houses on the segment $[t-d,t+d]$ (including boundaries).
To simplify the integration (and simply not to mix anything up) all the three stations are planned to possess the equal power of $d$ . Which minimal value of $d$ is enough to provide all the houses in the village with cellular communication.
输入格式
The first line contains an integer $n$ ( $1<=n<=2·10^{5}$ ) which represents the number of houses in the village. The second line contains the coordinates of houses — the sequence $x_{1},x_{2},...,x_{n}$ of integer numbers ( $1<=x_{i}<=10^{9}$ ). It is possible that two or more houses are located on one point. The coordinates are given in a arbitrary order.
输出格式
Print the required minimal power $d$ . In the second line print three numbers — the possible coordinates of the base stations' location. Print the coordinates with 6 digits after the decimal point. The positions of the stations can be any from $0$ to $2·10^{9}$ inclusively. It is accepted for the base stations to have matching coordinates. If there are many solutions, print any of them.
输入输出样例
输入 #1
4 1 2 3 4
输出 #1
0.500000 1.500000 2.500000 3.500000
输入 #2
3 10 20 30
输出 #2
0 10.000000 20.000000 30.000000
输入 #3
5 10003 10004 10001 10002 1
输出 #3
0.500000 1.000000 10001.500000 10003.500000
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted