You will be given ‘M’ ranges each consisting of a left limit and a right limit. Then you will be given an integer ‘n’ and you need to select those particular ranges such that

- for each range (L,R) L<= n <= R, or n remains inside that range.
- We must access the acceptable ranges in the descending order of the right limit.

For example :

Ranges :

4 16

3 18

1 5

integer : 10

acceptable ranges : 4 16 and 3 18. (1,2) does not include 10.

answer:

3 18

4 16

(3 18) will come first as the right limit is greater (18 > 16).