Baby step Giant step
#描述#
<p style="color:#F00; font-size:16px"> Give you one sequence and some command and you solve it! </p>
<p> There are 2 kinds of command:</p>
<p style="font-size:18px; color:#069">
1, a L R val: this means you should add val to all elements in [L,R]
</p>
<p style="font-size:20px; color:#069">
2, b L R: this means you should tell me the sum of all elements in [L,R]</p>
warning: sequence index counts from 1.
#格式#
##输入格式##
Multi testcase.
First line contain 2 integer n,m (n,m<=100000)which means the length of the sequence and the
number of command
second line contain n initial values(<=1000) of the sequence.
Then m lines, each line will be a command. ( the added value will also <=1000)
##输出格式##
First output the case number(see the sample)
then the sums of all query.
#样例1#
##样例输入1##
4 4
1 2 3 4
a 1 1 2
b 1 3
a 2 3 2
b 2 4
4 4
1 2 3 4
a 1 1 2
b 1 3
a 2 3 2
b 2 4
##样例输出1##
case #1:
8
13
case #2:
8
13
#限制#
2000ms
32768KB
#提示#
#来源#
dd