#P7621. [AHOI2021初中组] 超市购物
[AHOI2021初中组] 超市购物
Description
Now, suppose Little Keke buys a total of types of goods. The unit price of the -th type is yuan, and he buys items. In the end, a 15% discount (85% of the original price) is applied, and any remaining amount less than one jiao is discarded. Can you help him compute the actual amount of money he needs to pay?
Input Format
The first line contains a positive integer , representing the number of types of goods.
The next lines each contain a two-decimal number and an integer , separated by a space, representing the unit price and the quantity purchased for the -th type. Note that the trailing zeros after the decimal point will not be omitted in the input.
Output Format
Output only one line: a one-decimal number, representing the actual amount of yuan Little Keke needs to pay after the discount and discarding the fractional part smaller than one jiao. Note that even if the digit after the decimal point is 0, you must still output it.
1
23.70 1
20.1
3
3.00 2
17.95 1
0.10 1
20.4
见附加文件的 shopping3.in。
见附加文件的 shopping3.ans。
Hint
[Sample 1 Explanation]
This is the example in the [Background] section.
[Sample 2 Explanation]
Little Keke’s original total is $3.00 \times 2 + 17.95 \times 1 + 0.10 \times 1 = 24.05$ yuan. After the 15% discount, it becomes yuan. After discarding the extra fractional part, it becomes yuan.
[Constraints and Notes]
Hint: If you are not familiar with floating-point numbers, try to use integers as much as possible.
- For of the testdata, it is guaranteed that .
- For another of the testdata, it is guaranteed that the answer is an exact multiple of one jiao.
- For of the testdata, it is guaranteed that , , .
Translated by ChatGPT 5
京公网安备 11011102002149号