cf/mirror

Permutations Harmony

CF
2034E2200· master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
4
3 3
4 2
5 1
3 2
Output
YES
1 2 3
2 3 1
3 1 2
YES
1 2 3 4
4 3 2 1
NO
YES
1 2 3
3 2 1
2034E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)