Custom comparator
def comparator ( p1 , p2 ) : NEW_LINE INDENT a = p1 [ 0 ] NEW_LINE b = p1 [ 1 ] NEW_LINE c = p2 [ 0 ] NEW_LINE d = p2 [ 1 ] NEW_LINE val1 = a / b NEW_LINE val2 = c / d NEW_LINE return val1 > val2 NEW_LINE DEDENT