Please read the new rule regarding the restriction on the use of AI tools. ×

Can someone give me a solution for it?
Difference between en1 and en2, changed 14 character(s)
Given an array of N numbers, all of which are initially 0. You need to process 2 types of queries:↵
• Query type 1 has the form 1 L R A B, we add to the ith element (i − L)A + B the unit with↵
all L 
i CHEAP<= i <= R
• Type 2 query has the form 2 L R, we need to print the sum of the elements in the range [L..R], get the remainder for↵
10
^9 + 7.↵
Input data↵
• The first line contains 2 numbers N and M which are the number of elements in the array and the number of queries (1 N, M 105↵
).↵
• The next M lines each record a query in one of the two categories above.↵
• The numbers in the input are all greater than or equal to 1 and less than or equal to 10
^9↵
.↵
Result out↵
• For each type 2 query, write 1 line of the answer

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English LeoLeuLeo0 2022-10-26 06:52:49 14
en1 English LeoLeuLeo0 2022-10-26 06:51:53 756 Initial revision (published)