#P3885. [JLOI2009] F1一级方程式大赛
[JLOI2009] F1一级方程式大赛
Description
{{We know that in F1, if all other parameters are the same, a car’s speed mainly depends on its fuel load. Carrying too much fuel will slow the car down and increase fuel consumption per lap; carrying too little fuel requires more pit stops to refuel. Therefore, a key task for the think tank is to determine the initial fuel load and the pit-refueling plan before each race so that the total time to complete all laps is as short as possible.
As the chief programmer Dr. Liu, the team’s task is to write a program to determine Schumacher’s initial fuel load before the race and the pit-refueling plan during the race.}}
Input Format
{{The input consists of the following numbers:
- The total number of laps (a positive integer).
- The time for a theoretically empty car with no fuel to complete one lap (floating-point, in seconds).
- For each additional liter of fuel, the extra time per lap (floating-point, in seconds).
- The fuel consumed per lap for a theoretically empty car with no fuel (floating-point, in liters).
- For each additional liter of fuel, the additional fuel consumption per lap (floating-point, in liters, and this number is strictly less than ).
- The time spent for each pit stop (floating-point, in seconds; this does not include the time spent refueling, which is determined by the next input parameter).
- After each pit stop, the time spent per additional liter of fuel added (floating-point, in seconds).
We always treat one whole lap as a unit. Changes in fuel during a lap are not considered. Refueling is allowed only after completing a whole lap.}}
Output Format
{{- The first line contains three numbers:
- The minimum total time needed for Schumacher’s car to finish all laps (floating-point, rounded to three decimals).
- The initial fuel load before the race (floating-point, rounded to three decimals).
- The number of pit stops for refueling during the race (integer).
- Then follow lines, each containing two numbers:
- The number of laps completed at the time of the -th pit stop for refueling (integer).
- The amount of fuel added at the -th pit stop (floating-point, rounded to three decimals).}}
3 100 0 10 0 20 0
300.000 30.000 0
3 100 2 10 0.1 20 1
422.469 23.457 1
2 11.111
3 100 4 10 0 20 1
480.000 10.000 2
1 10.000
2 10.000
Hint
{{For all testdata, , and all other input numbers lie in the range .}}
Translated by ChatGPT 5
京公网安备 11011102002149号