Error
|
|
---|---|
@Ibrahim Nash | 5761 |
@blackshadows | 5715 |
@akhayrutdinov | 5111 |
@mb1973 | 4989 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 1115 |
@bt8816103042 | 739 |
@SherlockHolmes3 | 447 |
@codeantik | 441 |
@SHOAIBVIJAPURE | 430 |
@shalinibhataniya1097 | 408 |
@ShamaKhan1 | 392 |
@neverevergiveup | 381 |
@amrutakashikar2 | 355 |
@mahlawatep | 353 |
@murarry3625 | 352 |
Complete Leaderboard |
For a given array of price of items,you have to calculate the sum and average of all prices upto 2 decimal places.
Input:
First line of the input contains an integer T which denotes the number of test cases. Then T test cases follow. Each test case contains two lines.
The first line of each test case contains N denoting the number of items in the array.
The second line contains N space-separated integers - P1, P2, ..., PN denoting prices of items.
Output:
For each test case, print space separated sum and average of all the items resepctively.
Constraints:
1<=T<=100
1<=N<=100
1<=Pi<=1000
Example:
Input:
2
5
1 2 3 4 5
9
2 55 85 656 52 554 545 5 2
Output:
15 3.00
1956 217.33
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes