#Lutece1858. Unintended Consequences
Unintended Consequences
Migrated from Lutece 1858 Unintended Consequences
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
You are given an array of size , and here's an extra array of size , initially, each element of the array is zero.
You need support queries of following three types.
-
: Add to .
-
: Make for .
-
: Query .
Input
The first line contains two integers and .
The next line contains integers indicates each element of .
Each of the next lines contains a query in the format given in the statement.
Output
For each query of type , print the corresponding answer in a single line.
Samples
6 4
7 7 2 0 0 2
3 2 4
1 2 5 4
2 2 3 7 6
3 1 5
0
131
Resources
The 16th UESTC Programming Contest Preliminary