There are two players $X$ and $Y$. They write $N$ integers on paper $( A_1 , A_2 , A_3 , .... A_N )$.
They have also $M$ integers $(B_1 , B_2 , B_3 , .... B_M )$ .
Now, Player $X$ always takes turn first. He can choose any integer $A_i$ from
the list and choose any integer $B_j$ from the second list and change $A_i$ to $\dfrac{A_i}{B_j}$
If $B_j$ doesn't divide $A_i$ then he just replaces $A_i$ with $\Bigl\lfloor{\frac{A_i}{B_j}}\Bigr\rfloor$.
Once some $A_i$ becomes $0$ it can be removed from the list . The player who can
not make any move loses.
What is the solution of this problem ? How can I covert it to some familiar Nim problem ?