Loading repovive.com/contests/3/problems/G
You are given two integers and , where is even. Consider the complete graph on vertices .
You must partition all edges of into exactly spanning trees such that in each spanning tree, the degree of every vertex is either or .
If it is impossible, print No. Otherwise, print Yes and output the partition in the format described below.
For each test case, output either:
or:
where (for ) is the index of the spanning tree that contains the edge , and it must satisfy: .
The output labels all edges into spanning trees, and in each tree every vertex has degree or .
The output labels all edges into spanning trees, and in each tree every vertex has degree or .