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
Output:
2Output:
1.0000000000Input
Output:
20Output:
3.8922655409Credits to: Alar Toomre
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.