Deleting Divisors
MediumRating 1700CodeforcesMixed Practice
Approach hintTry it first, then revealHide
Tabulate small values first: odd numbers turn out to be losing, and an even number that is not a power of two can always move to an odd one. Powers of two need separate care, since only halving is worth considering.