# 『杭电1844』Intermediate Rounds for Multicasting

## Problem Description

Consider a communication network consisting of N nodes numbered from 1 to N. The nodes are interconnected in such a way that the network has the shape of a rooted tree, with node 1 as the root. Node 1 wants to send a message (the same message) to each node which is a leaf in the tree (i.e. has no sons) – this operation is known as multicast. A message can only be sent from one node to one of its descendants (including the node itself). Each edge of the tree has an associated cost and the cost of sending a message from a node X to one of its descendants Y is the sum of the costs of the edges on the unique path from X to Y (if X=Y, then the cost is 0). The total cost of a multicast strategy is the sum of the costs of sending each message.
In order to reach its goal, node 1 will use the following multicast strategy: The strategy consists of K intermediate rounds. In the first round, node 1 sends

05-20 2603
12-30 6234
01-23 7955
02-09 311
11-30 1万+
12-11 1万+
05-08 2万+