Weight of each node
weight = [ 0 for i in range ( n + 1 ) ] NEW_LINE weight [ 1 ] = - 8 NEW_LINE weight [ 2 ] = 9 NEW_LINE weight [ 3 ] = 7 NEW_LINE weight [ 4 ] = - 4 NEW_LINE weight [ 5 ] = 5 NEW_LINE weight [ 6 ] = - 10 NEW_LINE weight [ 7 ] = - 6 NEW_LINE