82 teams scored 1450 points on this task, for a maximum score of 100, an average score of 18 and a median score of 10.
Alice and Bob are playing a game: they have a pile of N rocks, and in every turn the current player takes at least 1 rock and at most K rocks. Alice makes the first move, then Bob does the second, and so on as they alternate turns. If one player takes an odd number of rocks, he has to pay M euros. When the pile is empty, the player who made the last move gets P euros and the other one gets Q euros. After the game ends, Alice will end up with an amount of euros, let's call it X, and Bob will end up with another amount of euros, let's call it Y. They both play optimally, which means Alice wants to maximize the value X - Y and Bob wants to minimize it. Find out the value of X - Y.