#000127

z-capacitors

For his Monday homework Little Z has to make an N by N mesh of capacitors. He made nearly perfect mesh but since the time was very limited, he decided to bring to school what he was able to finish so far.


Little Z also has to find out what is the total capacitance of his N by N unfinished mesh of 1 farad capacitors. By total capacitance we mean the capacitance from the left top corner to the bottom right corner. On the image you can see his configuration for N = 5


Image: kondenzatori

Little Z is not very good in physics and he use following formulas: two capacitors in serial connection have C<sub>tot</sub> = 1/C<sub>1</sub> + 1/C<sub>2</sub> and two capacitors in parallel connection has C<sub>tot</sub> = C<sub>1</sub> + C<sub>2</sub>.


Image: veze

InputFrom the standard input read one integer N, 2 <= N <= 100000

OutputTo the standard output write one real number with 10 decimal point precision, representing the total capacitance of the N by N unfinished mesh.

Input
5
Output:
4.2450980392

Input
20
Output:
4.0525931650


Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.