Here we have two ranges that may intersect, overlap, or coincide with each other. The bounds for any endpoint, $e$, are $1 \leq e \leq 10^9$ inclusive, but the endpoints of each range, independently, do not coincide (we're told $l1 \lt r1, l2 \lt r2$).
We want two distinct points, the first in the first range, and the second in the second range. We also are given that there may be up to $500$ queries. Basically, we want to narrow the two ranges down, then step through and look for two distinct points.