Comparator function to sort the vector of pairs
bool comp ( pair < int , int > & a , pair < int , int > & b ) { if ( a . second != b . second ) return a . second > b . second ; return a . first < b . first ; }