• For the heap initially containing 330 stones:
Bogdan has a winning strategy. One such strategy is the following:
1. If Alina chooses a number n which is not a multiple of 3, then Bogdan chooses m=2 (or any other number that is not a multiple of 3 in case Alina has chosen n=2);
2. If Alina chooses 3 or 9, Bogdan chooses 5;
3. If Alina chooses 6, Bogdan chooses 4.
In the first case, the number of stones Alina leaves in the heap is not a multiple of 3; Bogdan will take 1 or 2 stones, leaving a heap with a number of stones multiple of 3. Thus, at the end, Bogdan is the one that leaves 0 stones in the heap.
If Alina chooses an odd number, in particular 3 or 9, Bogdan can choose m odd and whatever Alina moves, he can always take one stone from the heap. After Alina's moves, the heap will always contain an odd number of stones, so she cannot win.
If Alina chooses 6, Bogdan chooses 4 and he will move as follows: if Alina takes 1 or 6 stones, Bogdan takes 4, and if Alina takes 4, Bogdan takes 1. Thus, after Bogdan's moves the number of stones in the heap will always be a multiple of 5, while after Alina's moves it will not be a multiple of 5. Bogdan wins again.
• For the heap initially containing 2018 stones:
Alina has a winning strategy. One such strategy is the following:
She chooses n=2.
- If Bogdan chooses m∈{4,5,7,8}, Alina moves such that the number of stones she leaves in the heap is always a multiple of 3 (initially she takes 2 stones).
- If Bogdan chooses m=3, Alina moves such that the number of stones she leaves in the heap is always a multiple of 4 (initially she takes 2 stones). (If Bogdan takes 1, 2 or 3 stones, Alina takes 3, 2, and 1 stone(s), respectively, leaving a number of stones that is a multiple of 4.)
- If Bogdan chooses m=6, Alina moves such that the number of stones she leaves in the heap gives one of the remainders 0 or 3 when divided by 7 (initially she takes 2 stones). Later, if Bogdan finds 7k stones in the heap and takes 1, 2 or 6 stones, then Alina takes 6, 2, or 1 stones, respectively, while if Bogdan finds 7k+3 stones in the heap and takes 1, 2 or 6 stones, Alina takes 2, 1, or 1 stones, respectively.
- If Bogdan chooses m=9, Alina moves such that the number of stones she leaves in the heap gives one of the remainders 0, 3 or 6 when divided by 10 (initially she takes 2 stones). Later, if Bogdan finds 10k stones in the heap and takes 1, 2 or 9 stones, then Alina takes 9, 2, or 1 stones, respectively, leaving 10(k−1) or 10(k−1)+6 stones. If Bogdan finds 10k+3 stones in the heap and takes 1, 2 or 9 stones, Alina takes 2, 1, or 1 stones, respectively, leaving 10k or 10(k−1)+3 stones. (The last situation is possible only if k=0). If Bogdan finds 10k+6 stones in the heap and takes 1, 2 or 9 stones, Alina takes 2, 1, or 1 stones, respectively, leaving 10k+3 or 10(k−1)+6 stones. (The last situation is possible only if k=0).
Thus, irrespective on Bogdan's choice of m, Alina wins by choosing n=2.