Here is my LRQUER solution.
(A_M-A_L)*(A_R-A_M) = (A_R+A_L)*A_M-A_M^2-A_L*A_R. The last term is constant, so it doesn’t matter. You are looking for maximum of (A_R+A_L)*A_M-A_M^2 thus minimum of A_M^2-(A_R+A_L)*A_M. You can notice, that A_M^2-(A_R+A_L)*A_M = (A_M-\frac{A_R+A_L}{2})^2-(\frac{A_R+A_L}{2})^2. The second term is constant, so it doesn’t matter. Thus you are looking for minimum of (A_M-\frac{A_R+A_L}{2})^2 which is the same as minimum of \left|A_M-\frac{A_R+A_L}{2}\right|, so you need to find the element with minimum absolute difference from \frac{A_R+A_L}{2}.
In a node store all the array numbers in a multiset, which are below the node.
This segment tree has N*\log{N} space complexity, which fits in ML for N \leq 10^5. Building the segment tree can be done as usually, you have to merge the two children’s sets in a node.
When updating, you can erase the old value from the set, and insert the new one. It takes O(\log{N}) to update a node, and you have to update O(\log{N}) nodes, so overall updating is O(\log^2{N}).
When querying, you can go through the O(\log{N}) nodes which contains the values of the segment. At each node, you can do a lower_bound on the set for \frac{A_L+A_R}{2}, and thus check the elements closest to it. It takes O(\log{N}), so overall query is O(\log^2{N}).
This results in O(Q\log^2{N}) time complexity.