Problem : RUPSA AND THE GAME CODECHEF . NEED HELP .
The problem is mentioned here .
The editorial is not clear enough for me . Can anybody help me ?
Codeforces Round 946 Solution Discussion