You are given a tree and two possible operations that can be applied to the tree:
Find the minimum cost necessary to transform the tree into a star.
A star is a special type of tree with $$$n$$$ nodes, in which $$$n - 1$$$ vertices have degree $$$1$$$ and a single vertex has degree $$$n - 1$$$ (is connected to all other vertices).
The first line of the input contains the number of nodes, $$$3 \le N \le 10^5$$$, and the costs of the two operations, $$$1 \le c_1, c_2 \le 10^9$$$.
The following $$$n - 1$$$ lines each contain two integers $$$a, b$$$, with $$$1 \le a, b \le n$$$, meaning that there is a bidirectional edge between node $$$a$$$ and node $$$b$$$.
The only line in the output should contain an integer representing the minimum cost necessary to transform the tree into a star.
5 10 15 1 2 2 3 3 4 4 5
10