#abc146d. [abc146_d]Coloring Edges on Tree

[abc146_d]Coloring Edges on Tree

给定一棵树,要求每个节点的各个出边的权值互不相同。求至少需要多少种不同的权值,并构造一颗这样的带权树。