cf/mirror

wxhtzdy ORO Tree

CF
1878G2300· international master5s256 MB⌨ stdin/stdout

Examples

Sample 1of 3multi-test • hover to link
Input
3
4
1 2 3 4
1 3
1 2
1 4
3
1 1
1 3
1 4
3
7 6 3
3 1
2 1
4
1 1
1 2
1 3
2 3
1
4
1
1 1
Output
2 4 3
6 6 6 6
2
Sample 2of 3multi-test • hover to link
Input
3
7
4 7 7 4 10 8 10
6 1
3 1
2 1
7 4
1 5
4 2
4
7 5
2 3
4 5
2 5
6
9 5 6 2 4 6
5 1
2 1
1 6
4 3
1 3
4
6 1
1 4
4 3
3 5
7
5 1 3 7 5 1 6
2 1
5 4
2 3
3 4
7 6
6 3
2
4 2
7 7
Output
8 6 7 7
6 6 4 7
6 4
Sample 3of 3multi-test • hover to link
Input
1
7
6 8 7 2 5 8 7
2 1
3 2
4 3
4 6
4 5
6 7
4
1 5
6 7
4 5
1 4
Output
7 7 5 7
1878G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…