| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 128 MB | 2 | 1 | 1 | 50.000% |
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 stops 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.
Standard input consists of several lines of input, each containing:
For each input line, print the following information
All floating point results should be printed to 3 decimal places. All numbers on a single line should be separated by a single space.
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
3 100.000 0.000 10.000 0.000 20.000 0.000 300.000 30.000 0 3 100.000 0.000 10.000 0.100 20.000 0.000 300.000 37.174 0 3 100.000 2.000 10.000 0.000 20.000 1.000 410.000 20.000 1 2 10.000 3 100.000 4.000 10.000 0.000 20.000 1.000 480.000 10.000 2 1 10.000 2 10.000 3 100.000 2.000 10.000 0.1000 20.000 1.000 422.469 23.457 1 2 11.111