cf/mirror

Manhattan Permutations

CF
1978C1300· pupil2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
8
3 4
4 5
7 0
1 1000000000000
8 14
112 777
5 12
5 2
Output
Yes
3 1 2
No
Yes
1 2 3 4 5 6 7
No
Yes
8 2 3 4 5 6 1 7
No
Yes
5 4 3 1 2
Yes
2 1 3 4 5
1978C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)