Divide top by D [ i ] if it is possible and push the result in q
if ( d [ i ] != 0 && top % d [ i ] == 0 && ! visited . getOrDefault ( top / d [ i ] , false ) ) { q . add ( top / d [ i ] ) ; visited . put ( top / d [ i ] , true ) ; }