C ++ program to implement the above approach
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool func ( pair < int , int > i1 , pair < int , int > i2 ) { return ( i1 . first - i1 . second < i2 . first - i2 . second ) ; }