题目描述
Problem Background
AHOI2021 Junior Group T1
You can choose to skip the background section.
On a spring day, when the weather is neither warm nor cold, a sudden gust of wind blows. Xiao Keke wraps herself in her thin coat and hurries to Xiao Xue's house.
"Today really isn't a good day to go out!" Xiao Keke exclaims.
"But I still need to buy something... will you accompany me to the supermarket?"
In the supermarket, Xiao Xue bought items totaling 23.70 yuan but ended up paying only 20.1 yuan, which puzzled Xiao Keke.
"The supermarket offers discounts to students, so they get an 85% discount at the end."
"That still doesn't add up to this price... I think it should be 20.145 yuan."
"When the supermarket settles the bill, they round down to the nearest jiao (tenth of a yuan), meaning they discard any fractional amount less than one jiao."
Problem Description
Now, suppose Xiao Keke bought a total of $n$ types of goods, with the unit price of the $i$-th type being $a_i$ yuan and the quantity bought being $b_i$ items. After applying an 85% discount and rounding down to the nearest jiao, can you calculate the actual amount she needs to pay?
Input Format
The first line contains a positive integer $n$, representing the number of different types of goods.
The following $n$ lines each contain a two-decimal-place number $a_i$ and an integer $b_i$, separated by a space, representing the unit price and the quantity purchased of the $i$-th type of good. Note that zeros after the decimal point will not be omitted in the input.
Output Format
A single line containing a one-decimal-place number, representing the actual amount Xiao Keke needs to pay after the discount and rounding down. Note that even if the digit after the decimal point is zero, it must be output.
Sample Input and Output
Sample Input #1
1
23.70 1
Sample Output #1
20.1
Sample Input #2
3
3.00 2
17.95 1
0.10 1
Sample Output #2
20.4
Sample Input #3
See the attached file shopping3.in.
Sample Output #3
See the attached file shopping3.ans.
Notes
Sample 1 Explanation
This is the example from the problem background.
Sample 2 Explanation
Xiao Keke's original purchase amount is $3.00 \times 2 + 17.95 \times 1 + 0.10 \times 1 = 24.05$ yuan, after an 85% discount it becomes $24.05 \times 85\% = 20.4425$ yuan, and after rounding down, it is $20.4$ yuan.
Data Range and Hints
Hint: If you are not familiar with floating-point numbers, try to use integers as much as possible.
- For $30\%$ of the test cases, $n=1$ is guaranteed;
- For another $30\%$ of the test cases, the answer is guaranteed to be an integer number of jiao;
- For $100\%$ of the test cases, $1 \le n \le 10$, $0.01 \le a_i \le 99.99$, $1 \le b_i \le 10$ are guaranteed.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分