#P1016. [NOIP 1999 普及组/提高组] 旅行家的预算
[NOIP 1999 普及组/提高组] 旅行家的预算
Description
A traveler wants to drive a car from one city to another at the minimum cost (assume the fuel tank is empty at the start). Given the distance between the two cities , the fuel tank capacity (in liters), the distance per liter , the price per liter at the starting point , and the number of gas stations along the route , as well as the distance from the starting point to gas station , , and the price per liter at gas station , , you need to find the minimum cost.
Input Format
The first line contains four real numbers and one integer , as described above.
For each of the next lines, the -th line contains two real numbers and , as described above.
Output Format
Print a single real number, the minimum cost (rounded to two decimal places).
If it is impossible to reach the destination, output No Solution.
275.6 11.9 27.4 2.8 2
102.0 2.9
220.0 2.2
26.95
Hint
Constraints: , , .
NOIP 1999 Junior problem 3, Senior problem 3.
Translated by ChatGPT 5
京公网安备 11011102002149号