cf/mirror

Dynamic Values And Maximum Sum

CF
2209F2700· international gm5s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
7
5 4
19 20 39 81 2
1 2
1 3
2 4
2 5
5 3
12 21 39 8 21
1 2
1 3
3 4
2 5
5 2
129 216 32 83 221
1 2
1 3
3 4
4 5
5 3
15 15 15 15 15
1 2
1 3
1 4
1 5
1 1
1
2 1
1 1000000000
1 2
7 2
8 3 5 7 9 1 6
4 3
7 5
5 2
2 3
3 6
6 1
Output
161
101
681
60
1
1000000000
32
2209F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…