in this problem i am using multiset<pair<int, int>> to store range l,r;but it gives WA on 253rd case .although when using separate multiset for both l and r it is accepted.i thought but could not come up with reason .can anyone help me with this .266946652

because you need to know the min and the max of l and h separately

yeah realized my mistake .thanks for help

You assume that

`s.begin()->second`

is the smallest $$$r$$$ in the multiset. That is not necessarely the case:In this configuration, you would print "NO" because $$$10 \ge 9$$$

ohh got it .tysm