Problem D
Manhattanstíflur
Languages
en
is

As you probably already know, the streets in Manhattan all
lay north to south or east to west. Let us number the streets
that go from north to south
Input
The first line of input contains a single positive integer
Output
If query number
Scoring
Group |
Points |
Constraints |
1 |
10 |
|
2 |
10 |
|
3 |
20 |
|
4 |
30 |
|
5 |
30 |
|
Sample Input 1 | Sample Output 1 |
---|---|
4 1 2 0 2 0 1 0 1 1 1 1 0 1 1 0 2 1 2 |
3 |
Sample Input 2 | Sample Output 2 |
---|---|
5 3 3 0 0 1 0 0 1 0 2 1 1 1 2 0 2 1 2 2 1 1 1 |
-1 |