TopCoder

餘切
$\huge\text{owoovo is 8}$

User's AC Ratio

80.0% (8/10)

Submission's AC Ratio

73.3% (11/15)

Tags

Description

Input Format

Output Format

Sample Input 1

4
1 2
1 3
2 4
2 5 7 8

Sample Output 1

16 3

Sample Input 2

4
1 2
1 3
2 4
8 9 2 3

Sample Output 2

18 2

Sample Input 3

3
1 2
2 3
2 0 2

Sample Output 3

2 0

Sample Input 4

10
1 3
3 8
1 5
8 7
3 4
4 10
3 9
8 6
10 2
841218180 93516879 211161646 884702327 929261395 626679311 72984464 851429900 805975971 454283475

Sample Output 4

877 140

Hints

Problem Source

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 2097152 65536
1 1000 2097152 65536
2 1000 2097152 65536
3 1000 2097152 65536
4 1000 2097152 65536
5 1000 2097152 65536
6 1000 2097152 65536
7 1000 2097152 65536
8 1000 2097152 65536
9 1000 2097152 65536
10 1000 2097152 65536
11 1000 2097152 65536
12 1000 2097152 65536
13 1000 2097152 65536
14 1000 2097152 65536
15 1000 2097152 65536
16 1000 2097152 65536
17 1000 2097152 65536
18 1000 2097152 65536
19 1000 2097152 65536
20 1000 2097152 65536
21 1000 2097152 65536
22 1000 2097152 65536
23 1000 2097152 65536
24 1000 2097152 65536
25 1000 2097152 65536
26 1000 2097152 65536
27 1000 2097152 65536
28 1000 2097152 65536
29 1000 2097152 65536
30 1000 2097152 65536
31 1000 2097152 65536
32 1000 2097152 65536
33 1000 2097152 65536
34 1000 2097152 65536
35 1000 2097152 65536
36 1000 2097152 65536
37 1000 2097152 65536
38 1000 2097152 65536
39 1000 2097152 65536
40 1000 2097152 65536
41 1000 2097152 65536
42 1000 2097152 65536
43 1000 2097152 65536
44 1000 2097152 65536
45 1000 2097152 65536
46 1000 2097152 65536