CF1133F2 Spanning Tree with One Fixed Degree
Description
You are given an undirected unweighted connected graph consisting of $ n $ vertices and $ m $ edges. It is guaranteed that there are no self-loops or multiple edges in the given graph.
Your task is to find any spanning tree of this graph such that the degree of the first vertex (vertex with label $ 1 $ on it) is equal to $ D $ (or say that there are no such spanning trees). Recall that the degree of a vertex is the number of edges incident to it.
Input Format
N/A
Output Format
N/A
Explanation/Hint
The picture corresponding to the first and second examples: 
The picture corresponding to the third example: 