Comparison function used to sort preSum vector .
def compare ( a , b ) : NEW_LINE INDENT if a [ 0 ] == b [ 0 ] : NEW_LINE INDENT return a [ 1 ] < b [ 1 ] NEW_LINE DEDENT return a [ 0 ] < b [ 0 ] NEW_LINE DEDENT