Average
C++20 (GCC 14): 1 s · Python 3.14: 3 s · Memory: 256 MB · Real answers within 0.000001
beginner math
Given N integers, print their arithmetic mean.
Answers within 10^-6 of the correct value (absolute or relative) are accepted.
Input
The first line has N (1 ≤ N ≤ 2·10^5). The second line has N integers a_i (|a_i| ≤ 10^9).
Output
Print the mean of the N integers.
Sample input 1
3 1 2 4
Sample output 1
2.333333333
Sample input 2
2 -1 2
Sample output 2
0.5
Loading editor…