Mike likes arithmetic sequences! So, he wants to create a data structure which maintains an array of
1 L R X V
Increase the elements at positions by . It is guaranteed that is a multiple of .2 L R X V
Set the elements at positions to . It is guaranteed that is a multiple of .3 Y
Output the value of the element at position .
Unfortunately, Mike does not know how to implement such a data structure. Can you help him implement this data structure and perform
Constraints
Subtask 1 [15%]
Subtask 2 [5%]
Subtask 3 [30%]
There are no operations of type
Subtask 4 [25%]
There are no operations of type
Subtask 5 [15%]
Subtask 6 [10%]
No additional constraints.
Input Specification
The first line contains two space-separated integers,
The
Output Specification
For each operation of type
Sample Input
5 4
1 1 5 2 4
2 2 4 1 6
3 1
3 2
Sample Output
4
6
Explanation
The initial array is
The first operation increases the values of the elements at positions
The second operation sets the values of the elements at positions
The third operation queries the value of the element at position
The fourth operation queries the value of the element at position
Comments