#P5765. [CQOI2005] 珠宝
[CQOI2005] 珠宝
Description
There is a tree with nodes. Assign a positive integer label to each node so that adjacent nodes have different labels, and the total sum of labels is as small as possible.
Input Format
The first line contains an integer .
The following lines each contain two integers , indicating that there is an edge between and .
Output Format
Only one line, the minimum possible sum of labels.
8
1 2
1 3
1 4
1 5
5 6
5 7
5 8
11
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号