Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/for-teskari-kvadratlar-yigindisi

Sum of inverse squares

Easy 1000 ms 64 MB 25%
Share

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}}$$

The sum of the series of inverse squares

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

Sign in to submit a solution

Signing up is free and takes a minute.