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
You assume that
s.begin()->secondis the smallest $$$r$$$ in the multiset. That is not necessarely the case:In this configuration, you would print "NO" because $$$10 \ge 9$$$