编程介的小学生 2017-09-01 17:05 采纳率: 20.5%
浏览 825
已采纳

Pit Stop Strategy

The speed of a racing car, all other factors being equal, depends on the amount of fuel it carries. In general, the weight of the fuel slows the car. In addition, the weight of the fuel increases fuel consumption. It is therefore an advantage to carry as little fuel as possible. Any amount of fuel may be loaded at the beginning of the race, and refueling pit shops may be made during the race. The time consumed for the pit stop increases with the amount of fuel loaded. Your task is to determine the optimal fueling and pit stop strategy for each of a number of cars, based on measurements taken immediately before the race.

Input

Standard input consists of several lines of input, each containing:

the number of laps in the race (integer less than or equal to 100)
the theoretical lap time [second] of the car on an empty tank (float)
the increase in lap time (float) per liter of fuel carried at the beginning of the lap (float)
the theoretical fuel consumption [liters per lap] on an empty tank (float)
the increase in fuel consumption per liter of fuel carried at the beginning of the lap (float; strictly less than 1)
the time [seconds] for a pit stop taking on no fuel (float)
the extra pit stop time per liter of fuel loaded (float)

Output

For each input line, print the following information

one line containing the seven input numbers in order
one line containing three integers:
total race time
the amount of fuel to be loaded initially
the number of pit stops
for each pit stop, a line containing:
the number of laps completed since the start of the race at the time of the pit stop
the amount of fuel to be taken on
All floating point results should be printed to 6 significant figures. All numbers on a single line be separated by a single space.

If there are several optimal strategies, break the tie with an earlier pit stop.

Sample Input

3 100 0 10 0 20 0
3 100 0 10 .1 20 0
3 100 2 10 0 20 1
3 100 4 10 0 20 1
3 100 2 10 .1 20 1

Sample Output

3 100 0 10 0 20 0
300 30 0
3 100 0 10 0.1 20 0
300 37.1742 0
3 100 2 10 0 20 1
410 20 1
2 10
3 100 4 10 0 20 1
480 10 2
1 10
2 10
3 100 2 10 0.1 20 1
422.469 23.4568 1
2 11.1111

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择