cf/mirror

Sums of Segments

CF
2026D1900· candidate master4s512 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
4
1 2 5 10
15
1 1
1 2
1 3
1 4
1 5
1 10
5 10
6 10
2 8
3 4
3 10
3 8
5 6
5 5
1 8
Output
1
4
12
30
32
86
56
54
60
26
82
57
9
2
61
2026D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)