The beach. With nowhere to run, the water-gun survival match our Hyakkaryouran team had entered began. The rules were simple: get wet, or leave the field and fall into the water, and you are out.
I surveyed the situation.
|
Kikyou |
An open beach in every direction. |
|
Kikyou |
If my prediction is correct, everyone will stay behind cover as much as possible to survive. |
|
Kikyou |
So I think our best approach is to build a position out of sand and hold it. |
|
Yukari |
Then allow this humble maiden to buy us time until it is ready! |
|
Renge |
Hmm, charging in is more my style, but if you say so, Kikyou. |
|
|
The first line contains a positive integer .
The second line contains the positive integers , , , , separated by spaces.
Print the minimum possible number of people remaining on the first line.
Nagusa
|
Then it's settled. Let's go with Kikyou's plan. |
...That should have been all there was to it. But the battle spread far beyond my expectations, and before I knew it, my palms were sweating.
|
Nagusa |
I knew I wasn't good enough... I only ever hold everyone back... |
|
Renge |
Aaah, everyone, pull yourselves together!! |
|
Kikyou |
...Where exactly did it all go wrong? |
|
Kikyou |
According to the plan, we shouldn't have gotten caught up in a battle this big... |
|
Arata |
S-such a merciless attack! You Hyakkaryouran lot will pay for this...!! |
|
Yukari |
That accusation is most unfair!! |
|
Renge |
Why is everyone only coming after us?! |
|
Arata |
You drained all our operating funds! We have to win the prize money!! |
|
Kikyou |
...What a heartbreaking reason. |
|
Renge |
Hmph, you brought it on yourselves! |
...Simply holding out in our sand fortifications isn't enough. But rushing out to grapple with them is out of the question. If I get wet, it's over.
That is why I brought a single-use net launcher to use from behind our sand cover. I intend to choose exactly one of the remaining people and fire a net at them from a distance. Once hit, they will panic and lose proper control of their water gun.
Our Hyakkaryouran team is holding a separate front, and the other participants in my field of view are standing in a line from left to right. Each participant has a health value that I have assessed. If I fire the net at a participant, that participant panics and repeatedly does the following.
As long as they have not been eliminated and at least one other person has not been eliminated, they repeat the actions below.
Each time, they randomly choose one person adjacent to them in the line and fight until a health value reaches .
A person whose health becomes can no longer resist, falls into the water, and is immediately eliminated.
When someone is eliminated, they are removed from the line and the remaining people close the gap without changing their order. Thus, who is adjacent to whom may change.
There is only one goal. I need to calculate the smallest possible number of people remaining, by choosing one person to send into a panic. I absolutely cannot lose this battle and fall into the water. No one can find out that I, the strategist of Hyakkaryouran, am afraid of water...!