Problem D
Raðir
Languages
en
is

You just lost a game to your friend. This does not bother you too much, since you just learned how to play the game, but you want to learn from your mistakes. Looking over your cards, you wonder how early you could have achieved a sequence, had you played optimally.
Input
The first line of the input contains two integers
Output
The output should contain one integer, the fewest number of turns it could have taken you to obtain a sequence. If no sequence can be optained, output “Neibb”.
Scoring
Group |
Points |
Constraints |
1 |
27 |
|
2 |
23 |
|
3 |
15 |
|
4 |
35 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
5 3 1 1 1 2 4 3 2 3 1 3 |
2 |
Sample Input 2 | Sample Output 2 |
---|---|
5 3 1 1 1 2 1 4 1 3 1 5 |
1 |
Sample Input 3 | Sample Output 3 |
---|---|
5 3 1 1 1 2 1 4 1 5 1 7 |
Neibb |