#P9993. [Ynoi Easy Round 2024] TEST_133
[Ynoi Easy Round 2024] TEST_133
Background
Please do not abuse the judging system of this problem. If you abuse it, your account will be banned.
Problem Description
Given a sequence , there are operations:
- Modify operation: given , increase the values of by .
- Query operation: given , ask for the maximum, among all indices satisfying and , of the historical maximum value of (i.e., the maximum among its initial value and its values after each modify operation).
Input Format
The first line contains two integers .
The next line contains integers .
The next lines each contain four integers , where denotes a modify operation, and denotes a query operation.
Output Format
For each query operation, output one line with the answer (in particular, if there is no index that satisfies the condition, output -inf).
5 10
-53 36 41 55 77
1 1 1 10
2 4 4 79
2 3 3 -28
1 1 5 -29
1 1 3 27
2 2 5 88
2 2 3 24
1 2 2 10
1 1 3 -9
1 2 5 -10
55
-inf
77
-inf
Hint
Idea: nzhtl1477, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
For of the testdata, .
For another of the testdata, the query operations guarantee and .
For another of the testdata, there are no modify operations.
For of the testdata, , (only the initially given sequence guarantees this limit), , and .
Translated by ChatGPT 5