#Lutece0283. Resistance

Resistance

Migrated from Lutece 283 Resistance

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

H.L. is preparing a circuit for the next coming physical experiment. His circuit consists of NN nodes, numbered 11 to NN, which are connected by wires with certain resistance. H.L is curious about the equivalent resistance between Node 11 and Node NN.

Input

Multi cases.The first line contains two positive integers NN and M, the number of nodes and wires in the circuit.(N,M100)( N, M \leq 100)

The next MM lines, each describe a wire connection by three integers X,Y,RX, Y, R which indicates that between Node XX and Node YY, there is a wire with resistance of RR ohm.

Output

he equivalent resistance rounded after the second decimal place.

Samples

2 2
1 2 1
1 2 1
0.50

Note

The data used in this problem is unofficial data prepared by 695375900. So any mistake here does not imply mistake in the offcial judge data.

Resources

POJ Founder Monthly Contest – 2008.03.16, g20