|
||||||||||
BIT SubwayTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 900 Accepted Submission(s): 445 Problem Description BIT(Beijing International Transport) subway, which can take people anywhere in a short time, is the most popular travel mode in 2050. One day, BIT subway launches a promotion as follows: - If the total ticket price $x$ you have spent this month is greater than or equal to 100 and you buy another ticket with ¥$y$, then you only need to pay ¥$0.8y$. - If the total ticket price $x$ you have spent this month is greater than or equal to 200 and you buy another ticket with ¥$y$, then you only need to pay ¥$0.5y$. DLee is so happy that he can save more money to buy a house. However, a long time later, he notices that the real billing method is a bit different from what he thought. For example, DLee has spent ¥199 on tickets this month, he now buys a ¥10 ticket, then buys an ¥8 ticket: - DLee thinks that he can buy only a part of the ticket instead of the whole ticket at a time. That is, for the ¥10 ticket, DLee thinks he can buy the ¥1.25 part of the ticket first and buy the ¥8.75 part of the ticket then. Under his misunderstanding, he needs to spend $199+1.25\*0.8+8.75\*0.5+8\*0.5=$¥$208.375$. Note that in this example, DLee has to spend ¥1.25 instead of only ¥1 to make $x=200$. - The real billing method is that only if you have spent enough, you can get the discount, so it will be $199+10\*0.8+8\*0.5=¥211$. Now DLee wants to know in the previous months, how much difference did the billing method make. Input Each test contains multiple test cases. The first line contains one integer $T(1\leq T\leq 10)$, which means the months DLee wants to check. Description of the months follows. The first line contains a single integer $n(1\leq n \leq 10^5)$, which means the number of tickets DLee bought in this month. Then follows $n$ integers $a_1,a_2,\ldots,a_n(1 \leq a_i \leq 200)$, $a_i$ means the $i$-th ticket's price. Output For each month, output one line with two numbers divided by a single whitespace with three decimal places. The first number represents the cost in DLee's thought, and the second number represents the real cost. Sample Input
Sample Output
Hint For the first case, DLee thinks the cost is: $20+20+20+20+18+2+((7-2)+8)\*0.8=¥110.4$, the real cost is: $20+20+20+20+18+7+8\*0.8=¥111.4$ Source | ||||||||||
|