#P13982. 数列分块入门 7
数列分块入门 7
Background
The constraint ranges of the test data of the Luogu Sequence Blocking Primer series differ from those of the original problems.
Problem Description
Given a sequence of length and operations, where the operations involve interval multiplication, interval addition, and single-point queries.
Input Format
The first line contains a number .
The second line contains numbers separated by spaces, where the -th number is .
Then queries follow, each on one line with four numbers , , and separated by spaces.
If , it means adding to all numbers in .
If , it means multiplying all numbers in by .
If , it means querying the value of ( and are ignored). You need to output a non-negative remainder.
Output Format
For each query, output one line with a single number, the answer.
7
1 2 2 3 9 3 2
0 1 3 1
2 1 3 1
1 1 4 4
0 1 7 2
1 2 6 4
1 1 6 5
2 2 6 4
3
100
Hint
Subtasks
Subtask 1 ( points): , .
Subtask 2 ( points): , .
For all test data, , , and .
Translated by QwenWork