#00011C

z-ohms

Little Z has to find out what is the total resistance of a N by N mesh of 1ohm resistors. By total resistance we mean the resistance from the left top corner to the bottom right corner. On the image you can see the configuration for N = 4


In the case you forgot your high school physics, google KVL and KCL to find out about the two basic electronic circuit laws. Or google parallel vs. serial resistor connections. Very very little physics knowledge is required to solve this problem.


Image: ohms

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

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

Input
2
Output:
1.0000000000

Input
20
Output:
3.8922655409

Credits to: Alar Toomre

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.