A10534 | As Fast As Possible
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
On vacations $n$ pupils decided to go on excursion and gather all together. They need to overcome the path with the length $l$ meters. Each of the pupils will go with the speed equal to $v_{1}$ . To get to the excursion quickly, it was decided to rent a bus, which has seats for $k$ people (it means that it can't fit more than $k$ people at the same time) and the speed equal to $v_{2}$ . In order to avoid seasick, each of the pupils want to get into the bus no more than once.
Determine the minimum time required for all $n$ pupils to reach the place of excursion. Consider that the embarkation and disembarkation of passengers, as well as the reversal of the bus, take place immediately and this time can be neglected.
Determine the minimum time required for all $n$ pupils to reach the place of excursion. Consider that the embarkation and disembarkation of passengers, as well as the reversal of the bus, take place immediately and this time can be neglected.
输入格式
The first line of the input contains five positive integers $n$ , $l$ , $v_{1}$ , $v_{2}$ and $k$ ( $1<=n<=10000$ , $1<=l<=10^{9}$ , $1<=v_{1}<v_{2}<=10^{9}$ , $1<=k<=n$ ) — the number of pupils, the distance from meeting to the place of excursion, the speed of each pupil, the speed of bus and the number of seats in the bus.
输出格式
Print the real number — the minimum time in which all pupils can reach the place of excursion. Your answer will be considered correct if its absolute or relative error won't exceed $10^{-6}$ .
输入输出样例
输入 #1
5 10 1 2 5
输出 #1
5.0000000000
输入 #2
3 6 1 2 1
输出 #2
4.7142857143
In the first sample we should immediately put all five pupils to the bus. The speed of the bus equals $2$ and the distance is equal to $10$ , so the pupils will reach the place of excursion in time $10/2=5$ .
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted