https://123dok.net/document/z3dxd8wm-preserving-spanning-tree-problem.html