cf/mirror

New Year Permutations

CF
1279E2700· international gm1s256 MB⌨ stdin/stdout

Examples

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