cf/mirror

Two Subarrays

CF
2042F2600· international gm3s512 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
7
3 -1 4 -3 2 4 0
0 6 1 0 -3 -2 -1
6
3 1 7
1 2 0
3 3 6
2 5 -3
1 3 2
3 1 5
Output
18
7
16
Sample 2of 2
Input
10
2 -1 -3 -2 0 4 5 6 2 5
2 -4 -5 -1 6 2 5 -6 4 2
10
3 6 7
1 10 -2
3 5 7
3 2 8
2 1 -5
2 7 4
3 1 3
3 3 8
3 2 3
1 4 4
Output
23
28
28
-17
27
-22
2042F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)