Spanning Tree with Maximum Degree

CodeForces - 1133F1