Point Assign, Range GCD — Solution & Editorial
An iterative segment tree supports point-assign and range-gcd in O(log N).
Complexity: O((N + Q) log N)
An iterative segment tree supports point-assign and range-gcd in O(log N).
Complexity: O((N + Q) log N)