cf/mirror

Chloe and pleasant prizes

CF
743D1800· expert2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
8
0 5 -1 4 3 2 6 5
1 2
2 4
2 5
1 3
3 6
6 7
6 8
Output
25
Sample 2of 3
Input
4
1 -5 1 1
1 2
1 4
2 3
Output
2
Sample 3of 3
Input
1
-1
Output
Impossible
743D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…