Problem Statement | |||||||||||||
A game is played as follows. The player is given a number p (his current p-value) between 0 and N-1 inclusive, where N is the number of elements in nexts.
The following steps are then repeated until the game ends:
| |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | nexts will contain between 1 and 50 elements inclusive. | ||||||||||||
- | Each element of nexts will be between 0 and N-1 inclusive, where N is the number of elements in nexts. | ||||||||||||
- | score will be between 0 and N-1 inclusive, where N is the number of elements in nexts. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|