cf/mirror

Min-Fund Prison (Hard)

CF
1970G32400· grandmaster1.5s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
4
4 6 5
4 3
2 3
2 4
1 2
4 1
3 1
6 6 2
1 4
2 5
3 6
1 5
3 5
6 5
6 5 7
1 4
2 5
3 6
3 5
6 5
7 5 4
1 4
3 6
3 5
6 5
2 7
Output
-1
20
25
33
1970G3.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…