If pair follow this condition insert the pair in vector ans
if ( v [ i ] * v [ j ] >= p * q / 4 && v [ i ] * v [ j ] <= p * q ) { List < int > temp = new List < int > ( ) ; temp . Add ( v [ i ] ) ; temp . Add ( v [ j ] ) ; ans . Add ( temp ) ; } } }