25 - NTHU CS Contest 2010 - Practice Scoreboard

Time

2010/05/29 09:30:00 2010/05/29 10:20:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
1599 Accumulated Error

1599 - Accumulated Error   

Description

For the safety concern, an elevator must have a limitation of the total weight it carries.  Supposed there are N people wants to take the elevator in the same time, it is important to know whether their total weight is over-weighted.  Unfortunately, measurement always comes with error.  Now, we know the weight of every person, and the error of the weight, marked as W+-E, like 72.0+-1.5.  Supposed the error is able to be accumulated, you are to determine the total weight of these N people, and the overall error of the sum of weight.

Input

There will be many test cases in a single file.

The first line of file contains one positive integer T, T≤10, indicating the number of test cases.

The following are T test cases.  For each case, it will have 3 lines as the information.  There is only one positive real number N, N≤100 in the first line, indicating the number of people.  The next line contains N real number, indicating the weight Wi for each person.  The third line also contains N integers, indicating the error Ei for each person. All Wi and Ei ≤ 200.

Output

For each test case, output a line with 2 real numbers which are the total weight and total error. You must output each real number with one digit after the decimal point, and separate them with a space.

If you use the in C language, you can use something like scanf(“%f”, &value) to read value, and use printf(“%.1f”, value) to write value.

Sample Input  Download

Sample Output  Download

Tags




Discuss