Driver code
int main ( ) { int arr1 [ ] = { 8 , 3 , 7 , 50 } ; int arr2 [ ] = { 5 , 1 , 10 , 4 } ; int K = 3 ; int n = sizeof ( arr1 ) / sizeof ( arr1 [ 0 ] ) ; int m = sizeof ( arr2 ) / sizeof ( arr2 [ 0 ] ) ; cout << totalPairs ( arr1 , arr2 , K , n , m ) ; return 0 ; }