Custom comparator
bool comp ( pair < long long , long long > p1 , pair < long long , long long > p2 ) { long double a = p1 . first , b = p1 . second ; long double c = p2 . first , d = p2 . second ; long double val1 = 0 , val2 = 0 ; val1 = a / b ; val2 = c / d ; return val1 > val2 ; }