function for updating the value
def update ( x : int , val : int , n : int ) -> None : NEW_LINE INDENT a = x NEW_LINE while a <= n : NEW_LINE INDENT BIT [ a ] += val NEW_LINE a += a & - a NEW_LINE DEDENT DEDENT