[GCOI Round #1 E] Network
题目描述
Mr Aoligei became the boss of the network company. There are houses (including the company) in his network, N-1 bidirectional channels to connect the nodes, and there always exists a route from any house to another house. Each channel is 1 kilometer long. The company is house and the money a house needs to pay is the distance of the route between the company and the house.
Now, Mr Poo lives in house . He wants to know how much money does he need to pay.
输入格式
The first line of the input file contains two integers: .
Following N-1 lines represent the channels in the original network of SN, each pair denote that there is a channel between node a and node b.
输出格式
Print out the money he needs to pay.
输入输出样例
Input #1:
Output #1: