eolymp
bolt
Try our new interface for solving problems
Problems

Harmonic series

Harmonic series

For a given value of $n$, compute the sum of the harmonic series: $$ 1 + {1 \over 2} + {1 \over 3} + {1 \over 4} + \cdots + {1 \over n} $$ \InputFile One positive integer $n~(1 \le n \le 10^4)$. \OutputFile Print the sum of the harmonic series with $4$ decimal places.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3
Output example #1
1.8333
Author Michael Medvedev