#P3934. [Ynoi Easy Round 2016] 炸脖龙 I
[Ynoi Easy Round 2016] 炸脖龙 I
Description
You are playing a galgame, but you find this gal confusing and give up. So you start writing a data structure problem instead.
Given a sequence of length , there are operations. Each operation is one of the following:
- Add to the range .
- For the range , query
Input Format
The first line contains two integers , the length of the sequence and the number of operations.
The second line contains integers, the sequence.
Each of the next lines is one of the following two operations.
- : add to the range .
- : query the range with modulus .
Output Format
For each query, output one number as the answer.
6 4
1 2 3 4 5 6
2 1 2 10000007
2 2 3 5
1 1 4 1
2 2 4 10
1
3
1
5 5
2 3 3 3 3
1 1 1 530739835
2 1 1 8356089
2 1 4 5496738
1 1 2 66050181
1 2 4 138625417
4306230
697527
Hint
Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477.
Constraints:
- For 100% of the testdata, , each number in the sequence is in , , and each added is in .
There are 10 sets of testdata.
Translated by ChatGPT 5
京公网安备 11011102002149号