| MOI2024 |
|---|
| Finished |
You are given a tree of $$$N$$$ nodes, and an integer $$$K$$$.
Your task is to partition the leaves of the tree into $$$K$$$ groups while respecting the following:
The first line contains two integers $$$N$$$ and $$$K$$$ ($$$3 \leq N \leq 10000, 2 \leq K \leq 20$$$)
The next $$$N-1$$$ lines contain two space separated nodes representing an edge $$$u$$$ $$$v$$$ ($$$ 1 \leq u, v \leq n$$$)
A single integer, the minimal cost of a partition among all possible partitions into $$$K$$$ groups.
10 210 62 103 104 101 25 68 94 85 7
12
| Name |
|---|


