Mzry1992 got sick recently. He had to go to the hospital for treatment. The time in the hospital was very boring, so Mzry1992 designed a game and wanted to persuade the nurse to play with him.
The game is played as follows: There are n piles of candies on the table. Each pile has a certain number of candies. Mzry1992 and the nurse take turns to eat candies. As the designed of the game, Mzry1992 always starts first. When it's someone's turn to eat candies, he must select a pile of candies (suppose the pile has m candies now), and eat x(0 < x <=
) candies. Otherwise, he loses the game.
("
" indicates the largest integer which is not greater than x)
The nurse loved candies, so she agreed to play with Mzry1992. To start the game, they began to prepare n candy piles. After they had arranged the first n-1 piles of candies (where the number of candies in the ith pile was x
i, 1 <= i <= n - 1), a new patient came in and the nurse had to go to take care of him. So Mzry1992 was left alone to decide the number of candies in the last pile.
But before the nurse left, she demanded that the last pile must have no less than L candies and no more than R candies, i.e. , L <= x
n <= R.
Mzry1992 agreed with the nurse's demand, since it would be unfair for the nurse if Mzry1992 could place any number of candies in the last pile. Now Mzry1992 wondered, if both he and the nurse play with their best strategies, how many different ways of placing candies in the last pile will make him lose?