
123  ZOJ Monthly, January 2013  I
DJT country and CG country are always on wars.
CG, of course, won't let DJT be happy for too long. CG is now planning to destroy DJT's new system. Due to some great undercover agents, CG has controlled some information about DJT's new system. The information CG has got:
Now, CG gives you a task: calculate the minimum power to destroy the system. InputThere are multiple cases. For each case, one integer n (0 <= n <= 10000) indicating the number of cities in DJY country, cities are numbered from 1 to n, the next n1 lines, one line contains four numbers describing one road, the two cities connected by the road, the length, and the power needed to destroy. The lengths are less than or equal to 10000. The powers are less than or equal to 100000000. All integers are nonnegative. OutputFor each case, output one number indicating the least power we need. Sample Input9 1 4 1 3 2 3 1 7 2 5 1 2 4 5 1 5 5 6 1 4 5 8 1 4 6 9 1 4 7 8 1 6 Sample Output4 Author: HE, Ningxu 