cf/mirror

Gardener and Tree

CF
1593E1600· expert4s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
6
 
14 1
1 2
2 3
2 4
4 5
4 6
2 7
7 8
8 9
8 10
3 11
3 12
1 13
13 14
 
2 200000
1 2
 
3 2
1 2
2 3
 
5 1
5 1
3 2
2 1
5 4
 
6 2
5 1
2 5
5 6
4 2
3 4
 
7 1
4 3
5 1
1 3
6 1
1 7
2 1
Output
7
0
0
3
1
2
1593E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…