luogu#P10708. [NOISG 2024 Prelim] Tourist
[NOISG 2024 Prelim] Tourist
Background
Translated from NOI SG 2024 Prelim A.Tourist.
Problem Description
You are a tourist, and you want to visit a city in days.
You have already planned your trip. On day , you need to take the train times.
You learned that there are two types of train tickets:
- Single-ride ticket: pay yuan to buy one single-ride ticket, which allows you to take the train time.
- Day pass: pay yuan to buy one day pass, which allows you to take the train any number of times within one day.
Please find the minimum total cost to buy train tickets.
Input Format
The first line contains three integers .
The second line contains integers. The -th integer represents .
Output Format
Output one integer in one line, representing the minimum cost.
3 4 9
2 3 2
25
Hint
Sample #1 Explanation
Your trip lasts for days. A single-ride ticket costs yuan, and a day pass costs yuan.
On the first day, buy single-ride tickets, costing yuan.
On the second day, buy day pass, costing yuan.
On the third day, buy single-ride tickets, costing yuan.
The minimum cost is yuan.
Constraints
| Score | Special Properties | |
|---|---|---|
| Sample | ||
| None | ||
For of the testdata, , , .
Translated by ChatGPT 5