Driver Code
int main ( ) { int R = 5 ; vector < pair < int , int > > arr { { 1 , 2 } , { 2 , 3 } , { 4 , 5 } } ; vector < int > queries { 2 , 4 , 1 , 3 } ; int N = arr . size ( ) ; int M = queries . size ( ) ; findMaxValueOfSet ( arr , queries , R , N , M ) ; return 0 ; }