cf/mirror

Checkposts

CF
427C1700· expert2s256 MB⌨ stdin/stdout

Examples

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