cf/mirror

Graph Reconstruction

CF
329C2400· grandmaster3s256 MB⌨ stdin/stdout

Examples

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