cf/mirror

Fair and Square

CF
2241E1600· expert3s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
4
5
1 1 1 1 1
1 2
2 3
2 4
4 5
10
1 2 3 4 5 6 7 8 9 10
1 3
2 6
6 7
5 4
8 3
3 4
4 6
9 1
10 2
6
12 6 3 18 9 2
3 4
4 5
2 6
6 1
4 2
8
3 16 9 1 8 16 4 9
2 1
3 1
4 3
3 5
6 3
4 7
8 1
Output
10
48
0
40
2241E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…