F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

BIT Subway

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 890    Accepted Submission(s): 441


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
3 7 20 20 20 20 18 7 8 13 30 20 23 20 7 20 11 12 30 20 30 15 13 3 10 200 10
 

Sample Output
110.400 111.400 213.000 216.900 196.000 215.000
 

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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-12 09:03:17, Gzip enabled