| Contests - ACM Student Chapter - PSUT |
|---|
| Private |
| Spectator |
| Summer-training-01-Beginners |
|---|
| Finished |
While Moon is trying to have a better life after his explosive break up, in order to be happy again he wanted to move on.
He started counting the number of empty seats on the train that they used to ride everyday but he doesn't want to sit in the same cabin as his EX.
The train consists of $$$n$$$ cabins and each cabin consists of $$$4$$$ seats. She is currently sitting in cabin $$$x$$$.
Moon wants to find the number of seats he can sit on.
The first integer contains one integer $$$n$$$ $$$(1 \le n\le10^5)$$$ — the number of cabins.
the second integer contain one integer $$$x$$$ $$$( 1 \le x\le n )$$$ — The cabin in which his EX sits in .
the next n integers represent the number of occupied seats in the ith cabin $$$(0 \le a_{i} \le 4 )$$$ .
Print the number of seats Moon can sit on
4 11 2 3 0
7
7 33 2 3 3 2 3 1
10
its guaranteed that there is at least one cabin that has at least one occupied seat ( His EX )
Moon in fact did not move on :´)
| Name |
|---|

