Function to update Segment Tree
def update ( a , pos , tl , tr , v ) : NEW_LINE INDENT global pref NEW_LINE global suf NEW_LINE global MAX NEW_LINE if ( tl > pos or tr < pos ) : NEW_LINE INDENT return NEW_LINE DEDENT DEDENT