~/algor $ cat problems/for-teskari-kvadratlar-yigindisi
Sum of inverse squares
Easy
1000 ms
64 MB
25%
A positive integer $n$ is given. Compute the sum:
$$S = \frac{1}{1^{2}} + \frac{1}{2^{2}} + \frac{1}{3^{2}} + \dots + \frac{1}{n^{2}}$$
Input
One positive integer $n$.
Output
One number — $S$, with exactly 4 digits after the decimal point (for example, 1.2500).
Note
$1 \le n \le 10^{5}$
Examples
Input #1
2
Output #1
1.2500
Input #2
3
Output #2
1.3611