cf/mirror

Spanning Tree with One Fixed Degree

CF
1133F21900· candidate master3s256 MB⌨ stdin/stdout

Examples

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