cf/mirror

Stone Age Problem

CF
1679B1200· pupil2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
5 5
1 2 3 4 5
1 1 5
2 10
1 5 11
1 4 1
2 1
Output
19
50
51
42
5
1679B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)