#P10529. [XJTUPC 2024] 勘探队
[XJTUPC 2024] 勘探队
Problem Description
An exploration team starts from and the destination is . They carry equipment numbered from to . The weight of equipment is , and it must be placed at any position whose -coordinate is (the -coordinate can be any real number). All equipment must be placed in order. Before all equipment with smaller indices have been placed, even if the -coordinate requirement is satisfied, the team still cannot place the current one.
When the total weight of the equipment carried by the team is , the cost to move one unit of distance is . Find the minimum total cost for the team to finish placing all equipment and arrive at the destination.
Multiple pieces of equipment can be placed at the same coordinate.
Input Format
The first line contains three positive integers (), (), and (), representing the number of devices, the basic movement cost, and the -coordinate of the final destination.
The second line contains positive integers (), representing the weight of device . They are separated by spaces.
The third line contains integers (), representing the required -coordinate for device .
Output Format
Output one line with one positive real number representing the final cost. If your answer is and the standard answer is , then your answer is considered correct if and only if .
1 25 14
14
12
882.000000
Hint
Walk in a straight line to , the distance is , then walk in a straight line to , the distance is . The total cost is . There is no better solution than this.
Translated by ChatGPT 5