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