students want to stand on a number line. Larger numbers represent positions farther to the right.
The students are numbered from to and stand from left to right in numerical order. All their positions are integers.
Let be the position of student (). The positions must satisfy the following conditions.
If , more than one student may stand at the same position.
The students want to make , the position of student , as large as possible.
Find an arrangement that satisfies the conditions and maximizes . If there are several, find any one of them.
It can be shown that at least one arrangement satisfies the conditions.
The first line contains two integers and , in that order, separated by a space.
The next line contains space-separated integers in that order.
Print space-separated integers on the first line. The arrangement must satisfy every condition in the statement and maximize .
If there are several valid outputs, any one is accepted.
| 2 | 35 |
| 3 | 30 | There is an arrangement satisfying the conditions with . |
| 4 | 10 | No additional constraints. |