~/algor $ cat problems/for-yigindi-va-ortacha
Sum and average
Easy
1000 ms
64 MB
29%
A positive integer $n$ and $n$ integers $a_{1}, a_{2}, \dots, a_{n}$ are given. Compute their sum $S$ and arithmetic mean $M$:
$$S = a_{1} + a_{2} + \dots + a_{n}, \qquad M = \frac{S}{n}$$
Input
The first line contains $n$. The second line contains $n$ integers separated by spaces.
Output
The first line contains the integer $S$. The second line contains $M$ with exactly 2 digits after the decimal point (for example, 5.00).
Note
$1 \le n \le 1000$
$-10^{6} \le a_{i} \le 10^{6}$
Examples
Input #1
3 4 5 6
Output #1
15 5.00
Input #2
4 1 -2 7 9
Output #2
15 3.75