编程介的小学生 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条回答

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码