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

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献