cf/mirror

Rae Taylor and Trees (hard version)

CF
2171F1600· expert3s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
9
6
1 3 4 5 2 6
4
3 4 1 2
5
4 3 5 1 2
4
1 2 3 4
7
4 3 5 7 6 2 1
6
2 4 6 1 3 5
3
2 1 3
4
2 4 1 3
6
4 2 6 5 1 3
Output
Yes
3 1
4 1
6 5
6 2
6 1
No
No
Yes
2 1
4 3
4 1
No
Yes
4 2
6 2
3 1
5 1
5 2
Yes
3 2
3 1
Yes
4 2
3 1
3 2
Yes
6 4
6 2
3 1
5 4
2 3
2171F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…