Problem B
Pizzubestun
Languages
en
is
Nonni has asked his guests what kind of pizza they would like, so he knows how many pizzas need to be ordered.
Nonni wishes to pay as little as possible for the pizzas and asks you for help. Given the pizzas he wishes to order and the price of each pizza you need to figure out which of them to pair together for the special deal to minimize the cost. The pizzas can also be ordered on their own for the listed price. All of the pizzas are large.
Input
The first line of the input contains the integer
Output
Print the minimum price for all the pizzas in the
input.
Scoring
Group |
Points |
Constraints |
1 |
50 |
|
2 |
50 |
|
Sample Input 1 | Sample Output 1 |
---|---|
4 Prinsinn 2499 Piparinn 2399 Margherita 1899 Pepparinn 2099 |
4598 |
Sample Input 2 | Sample Output 2 |
---|---|
3 Guffi 3099 BaraDodlur 2899 Margherita 1899 |
4998 |