Resistance
The terminals of an electrical circuit are numbered with natural numbers from 1 to n, inclusive. These terminals are interconnected by m resistors, each having a resistance measured in ohms, represented as a non-negative rational number.
Your task is to write a program that calculates the resistance between terminals 1 and n.
Input
The input begins with two natural numbers, n and m (1 ≤ n, m ≤ 2500). This is followed by m sets of four non-negative integers: two terminal numbers, and the numerator and denominator of the resistance value in ohms that connects these terminals.
Output
The output should be the resistance in ohms as an irreducible fraction. If the denominator of this fraction is 1, omit the fraction line / and the denominator. If there is no path of resistors connecting terminals 1 and n, output "Zero conductivity".