Check for each divisor i . e . arr [ i ] % b = k or not , if yes then print that pair .
for ( int j = 0 ; j < v . size ( ) ; j ++ ) { if ( arr [ i ] % v [ j ] == k && arr [ i ] != v [ j ] && occ [ v [ j ] ] ) { cout << " ( " << arr [ i ] << " , ▁ " << v [ j ] << " ) ▁ " ; isPairFound = true ; } }