#P8572. [JRKSJ R6] Eltaw
[JRKSJ R6] Eltaw
Background

As you walk alone under the moon, you cannot help but think of an easy problem.
(The background image is from a Phigros illustration. If there is any infringement, please inform the problem setter.)
Problem Description
You are given sequences , each of length . There are queries. Each query gives an interval , and you need to compute , i.e., the maximum interval sum over among all sequences.
Input Format
The first line contains three integers .
Then follow lines, each containing integers .
Then follow lines, each containing two integers representing one query.
Output Format
Output lines, each representing the answer to one query.
7 2 3
1 1 4 5 1 4 0
1 9 1 9 8 1 0
6 7
5 7
1 3
4
9
11
Hint
Idea: cyffff, Solution: cyffff, Code: cyffff, Data: cyffff
Eltaw - Fl00t (IN Lv 14.8)
The input and output files of this problem are large. Please use appropriate input/output methods.
Constraints
This problem uses bundled testdata.
| Special Constraints | |||
|---|---|---|---|
| Guaranteed | |||
| None |
For of the data: , , , .
Data Update Log
: Updated two sets of testdata, which invalidated two incorrect solutions with wrong time complexity. Thanks to
: Updated one set of testdata, which invalidated an incorrect memoization-based solution. Thanks to
If you can pass all current test points, then the complexity of your code is very likely correct. If you still think your complexity is wrong, please contact the problem setter.
Translated by ChatGPT 5