cf/mirror

Tree Reconstruction

CF
1041E1900· candidate master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4
3 4
1 4
3 4
Output
YES
1 3
3 2
2 4
Sample 2of 3
Input
3
1 3
1 3
Output
NO
Sample 3of 3
Input
3
1 2
2 3
Output
NO
1041E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…