cf/mirror

Stack Sorting

CF
911E2000· candidate master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 4
Input
5 3
3 2 1
Output
3 2 1 5 4
Sample 2of 4
Input
5 3
2 3 1
Output
-1
Sample 3of 4
Input
5 1
3
Output
3 2 1 5 4
Sample 4of 4
Input
5 2
3 4
Output
-1
911E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)