There is a permutation of
Define a range
If there are multiple permutations that provide the maximum number of range continuous segments please choose any one of them.
Subtasks # | Score | Constraits |
---|---|---|
1 | 10 | |
2 | 20 | |
3 | 10 | |
4 | 20 | |
5 | 40 | - |
The first line contains 2 integers
The second line contains
The first line should contain a single integer representing the maximum number of range continuous segments. The second line should contain the permutation.
Sample Input 1 | Sample Output 1 |
4 1
|
8
|
Subtask | Score |
---|---|
1 | 10 |
2 | 20 |
3 | 10 |
4 | 20 |
5 | 40 |