Check if current pair divides m or not If yes , then search for ( m / arr [ i ] * arr [ j ] )
if ( ( arr [ i ] * arr [ j ] <= m ) && ( arr [ i ] * arr [ j ] != 0 ) && ( m % ( arr [ i ] * arr [ j ] ) == 0 ) ) { int check = m / ( arr [ i ] * arr [ j ] ) ; auto it = occ . find ( check ) ;