#P1596. Exciting Tournament

Exciting Tournament

题目描述

Click here to read PDF of this problem

输入格式

As shown in the PDF.

输出格式

As shown in the PDF

样例

4 
41 2 
13 2 
36 3 
17 3 

94 110 

6 
66 5 
628 4 
216 5 
78 4 
230 5 
74 3 

882 2650 

提示

by 20张席畅