Class with: maxHeap (left breakpoints), minHeap (right breakpoints), base value, optional offsets. Method addAbsValue(a): push to both heaps, balance if , update base. Method prefixMin(): clear right heap, base stays. Method query(): base value is the minimum, and give the interval of minimizers. Use a max-heap for left breakpoints and min-heap for right. The heaps maintain the piecewise linear function.
Time complexity: .
Space complexity: in time and in space.