Approach hintTry it first, then revealHide
A portal never helps a point to the right of b_i, so replace it by the segment [l_i, b_i]. Merge overlapping segments, then answer each query by binary search over the merged list.
A portal never helps a point to the right of b_i, so replace it by the segment [l_i, b_i]. Merge overlapping segments, then answer each query by binary search over the merged list.