编程介的小学生 2019-06-06 18:10 采纳率: 20.5%
浏览 172

计算所有公共汽车经过转弯的最短时间,这个问题如果是采用C语言的程序设计的语言的过程应该如何来计算的

Problem Description
Garfield applied for a good job recently, and he will go to work soon by car or bus. Garfield is very broody, sometimes when he sits on the bus to wait for the traffic light, he thinks about how long all the buses pass the traffic turning.
Now we describe the situations when the buses stop at the traffic turning to wait for the traffic light. First the light is red, then when the light changes to green, all the buses are prepared to move. And at the beginning, all the buses are close to each other without any space, and they have different lengths and the largest speeds. We assume any car can reach the speed that isn’t beyond the maximal speed at once.
Now Garfield wants you to calculate minimal time all the buses pass the turning.

Input
There are many cases. For each case, there is two intergers N(1<=N<=100), representing the number of the buses. There are two interges in the following N lines, for the length Li(meter, 1<=Li<=10) and the maximal speed Si(meter/second, 1<=Si<=10) of the i-th bus.

Output
For each case, print the result obtaining two digits after the decimal point.

Sample Input
2
1 2
2 3

Sample Output
1.50

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮