cf/mirror

Lipshitz Sequence

CF
601B2100· master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
10 4
1 5 2 9 1 3 4 2 1 7
2 4
3 8
7 10
1 9
Output
17
82
23
210
Sample 2of 2
Input
7 6
5 7 7 4 6 6 2
1 2
2 3
2 6
1 7
4 7
3 5
Output
2
0
22
59
16
8
601B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)