#P10148. [Ynoi1999] M47升级型“钢铁阿诺”
[Ynoi1999] M47升级型“钢铁阿诺”
Background

Problem Description
Given an integer sequence of length .
You are also given a sequence of operations, numbered from to . The operations include update operations and range sum operations. An update operation gives and sets to . A range sum operation gives and asks for .
There are queries. Each query gives and asks: after initializing the sequence to , execute operations in order, and output the sum of the answers of all range sum operations during this process.
Input Format
The first line contains three integers .
The next lines each describe one operation in the form or .
The next lines each contain two integers , describing one query.
Output Format
Output lines. Each line contains one integer, in order, representing the answer to each query.
10 5 4
1 9 10 7
1 7 10 9
2 3 10
1 10 10 1
2 5 10
2 5
1 1
3 4
1 3
64
0
0
36
Hint
Idea: Ynoi, Solution: nzhtl1477&ccz181078, Code: ccz181078, Data: ccz181078.
Constraints: for all testdata, , , , and .
For of the testdata, .
For another of the testdata, .
For another of the testdata, every operation is a range sum operation.
For another of the testdata, every query satisfies .
For another of the testdata, .
For the remaining testdata, there are no special constraints.
Translated by ChatGPT 5