Problem A
Arcane Secret
Viktor has developed a special formula to try and understand
the secrets of the Arcane. He has
He can identify a core rune with the following process:
-
Divide the runes into
groups of equal size. -
Take the maximum strength rune of every group and add it into a set
. If multiple runes within a group tie for the maximum strength, one of them is randomly added into . Note that will have elements. -
The rune whose strength is the median of
is a core rune.
How many different runes can possibly be core runes?
Input
The first line of input contains
Output
Output the number of possible core runes that exist.
Sample Input 1 | Sample Output 1 |
---|---|
9 3 1 1 2 3 5 8 13 21 34 |
3 |
Sample Input 2 | Sample Output 2 |
---|---|
6 3 4 4 4 4 4 4 |
6 |