#P40024. 2017 ICPC Asia Daejeon Regional Contest A - Broadcast Stations

2017 ICPC Asia Daejeon Regional Contest A - Broadcast Stations

题目描述

image.png

输入格式

image.png

输出格式

image.png

样例

6 
1 2 
3 2 
2 4 
5 4 
6 4
2
12 
1 2 
2 3 
4 5 
5 3 
3 6 
6 7 
7 8 
8 9 
12 9 
9 11 
10 9
3