I'm surprised how simple the solution to B is. During the contest, I created a list of segments to check the validity of the ranges. I have completely overlooked the easy solution.
I'm surprised how simple the solution to B is. During the contest, I created a list of segments to check the validity of the ranges. I have completely overlooked the easy solution.