当前位置: 首页 > news >正文

温州建设网站google play 应用商店

温州建设网站,google play 应用商店,六盘水网站建设,国外b站刺激战场直播app一开始推以为要推出一个一元二次方程,然后二分解。后来越来越推不出,只好搜题解看看。 以下内容皆为转载,转自xgogoforit的博客 题意 开始的时候还没弄懂题意,以为就是一个追击问题的极限形式,但是样例都对不上。还有就是这句话…

一开始推以为要推出一个一元二次方程,然后二分解。后来越来越推不出,只好搜题解看看。


以下内容皆为转载,转自xgogoforit的博客

题意

开始的时候还没弄懂题意,以为就是一个追击问题的极限形式,但是样例都对不上。还有就是这句话as well as the reversal of the bus,我以为是返回的时候也是不要时间的意思,但是好像应该是车掉头不要时间 -。- … 

题意就是一群学生要到一个目的地去,他们当中没人可以有一次坐车的机会,问怎么才能使用的总时间最少。

题解

所用的总时间最少应该是大家都同时到达,没有人在终点等待其他人,也就没有时间浪费掉。在大家都同时到达的情况下,那么每人乘车的时间和步行的时间应该是相同的。

注意的double运算的时候,要保证每一个部分都是double,某些时候要强制转换。

推导:

设某人1处在x的位置,某人2乘车的距离为a,车送完某人2返回去接某人1的时间为t。 

一个要接g=n/k[分偶数奇数讨论+1or not +1]组人 

x+t*v1=x+a-(t-a/v2)化简得 t= (2 *a)/(v1+v2) 

最后一个人在车上与其他所有人同时到达终点,那么车行驶的时间与一个人所用的总时间是相同的则 

a/v2 + t*(g-1)=a/v2 +(l-a)/v1 化简得 a=(v1+v2) *l/(2 *g *v1+v2-v1) 

t=a/v2+(l-a)/v1

代码:

#include <cstdio>int n,k,r;
double l, v1, v2;int main()
{scanf("%d%lf%lf%lf%d", &n, &l, &v1, &v2, &k);r = n / k + ((n%k) ? 1 : 0);double g = (l*(v1 + v2)) / (2 * v1*((r - 1)*1.0) + v1 + v2);double ans = (l - g) / v1 + g / v2;printf("%.10lf\n", ans);return 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 v1. 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 v2. 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.

Input

The first line of the input contains five positive integers nlv1v2 and k (1 ≤ n ≤ 10 0001 ≤ l ≤ 1091 ≤ v1 < v2 ≤ 1091 ≤ 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.

Output

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.

Example
Input
5 10 1 2 5
Output
5.0000000000
Input
3 6 1 2 1
Output
4.7142857143
Note

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.


http://www.lbrq.cn/news/2748097.html

相关文章:

  • 定制开发一般多少钱搜索seo优化托管
  • 品牌网站建设公司太原百度公司地址
  • 百度网站排名开网站怎么开
  • 阿里云网站更换域名外包
  • 如何做企业套模网站宁德市教育局官网
  • 网站建设营销策划方案线上拓客渠道有哪些
  • 自己电脑做服务器搭建网站有域名网站推广多少钱一年
  • 网站建设网站排名优化金牌服务网络推广官网首页
  • 电脑网站推荐网络营销ppt
  • 在线编辑图片加字seo教程下载
  • 网站优化公司哪家效果好百度地址如何设置门店地址
  • wordpress的ajax好慢做优化的网站
  • 江西网站建设现在怎么做网络推广
  • 微信下载并登录seo技术分享博客
  • 电子商务网站开发的意义互联网营销师怎么做
  • 59网站一起做网店广州seo排名哪家有名
  • wordpress建站模版推广赚钱一个50元
  • 网站怎么申请支付宝google关键词分析
  • 买网站需要多少钱企业培训考试系统
  • 做淘宝相关网站湖南网站制作公司
  • 日照公司做网站淘宝流量助手平台
  • 网站建设推广邮件百度seo优
  • 东莞贸易公司寮步网站建设价格刷关键词要刷大词吗
  • 东莞网站建设类岗位廊坊网站seo
  • 做包装盒效果图网站优化大师下载安装
  • 雅安市住房和城乡建设局网站全专业优化公司
  • 阜宁专业做网站的公司全网营销推广靠谱吗
  • 电子商务网站建设与实践上机指导教程百度快照在哪里
  • 专业医疗建站营销型网站建设方案
  • 深圳制作网站软件百度seo网站优化服务
  • 飞算AI 3.2.0实战评测:10分钟搭建企业级RBAC权限系统
  • Baumer高防护相机如何通过YoloV8深度学习模型实现工作设备状态的检测识别(C#代码UI界面版)
  • Android 对话框 - 基础对话框补充(不同的上下文创建 AlertDialog、AlertDialog 的三个按钮)
  • Collections.synchronizedList是如何将List变为线程安全的
  • 文件快速复制工具,传输速度提升10倍
  • Flink作业执行的第一步:DataFlow graph的构建