Problem Statement | |||||||||||||
Bob and Sally play the following game. At the beginning of the game several stones lie in a box. The two players take stones in turns, and the player who takes the last stone wins. On each turn, a player may take T stones for any T in turns. For each number k between m and n, inclusive, the game is played once with the box containing k stones at the start of the game. Assuming both players play optimally, return how many times Bob will win (Bob always moves first). | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | turns will contain between 1 and 50 elements, inclusive. | ||||||||||||
| - | Each element of turns will be between 1 and 100, inclusive. | ||||||||||||
| - | Elements of turns will be in strictly ascending order. | ||||||||||||
| - | The first element of turns will be 1. | ||||||||||||
| - | n will be between 1 and 100000, inclusive. | ||||||||||||
| - | m will be between 1 and n, inclusive. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||