-->
当前位置:首页 > 题库

PROGRAMMING:Harmonic average

Luz5年前 (2021-05-10)题库449
The * * arithmetic mean * * of $$n $$positive numbers is the sum of these numbers divided by $$n $, and their * * harmonic mean * * is the reciprocal of their reciprocal arithmetic mean. This problem asks you to calculate the harmonic mean of a given series of positive numbers.
###Input format:
Each input contains one test case. The first line of each test case gives the positive integer $$n $$($$Le 1000 $$); The second line gives $$n $$positive numbers, all in the interval $$[0.1, 100] $.
###Output format:
Output the harmonic average value of a given sequence in a row, 2 decimal places after the output.
###Input example:
```in
eight
10 15 12.7 0.3 4 13 1 15.6
```
###Output example:
```out
one point six one
```







answer:If there is no answer, please comment