| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 52 | 32 | 31 | 64.583% |
Recently, you have acquired the newest book in the self-help category: "Becoming A Professional Consumer", containing a wide variety of tips on how to buy as much as possible, while paying as little as possible. One of the things that you already discovered while reading the book is that you have been paying too much for your groceries all your life!
This works as follows: in a supermarket, you can decide to pay with card or with cash. If you pay with cash, the amount you have to pay gets rounded to the nearest multiple of 0ドル.05, and if you pay with card, it does not. So, depending on your groceries, it can be cheaper if you pay with the right method! You can minimize your spendings even further by splitting your groceries into multiple groups, and paying separately for every group.
You have already decided on a list of the things that you are going to buy, and you know their prices. What is the cheapest way to buy all these groceries?
The input consists of:
1When a floating-point number is written in decimal form, it is not in scientific notation.
Output the minimal total amount of money you need to buy all the groceries, in euros. Your answer should have exactly two decimal places.
3 0.59 5.21 3.10
8.89
5 20.43 1.11 6.47 19.99 3.75
51.70
2 0.05 0.14
0.19
4 1.00 3.00 5.00 2.00
11.00
3 68.79 61.18 0.58
130.53
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 G번