All Submissions


Problem Statement

Given two integers 'x' and 'y', an array of numbers x to y is generated and the following three operations are defined:
  • a) The command "a b ." returns the sum of numbers between indices a and b.
  • b) The command "a b +" increments the numbers between indices a and b by 1.
  • c) The command "a b -" decrements the numbers between indices a and b by 1.

Input Specifications

Input contains x,y and C(the number of commands) until the end of file.The following C lines contain commands.

Output Specifications

For all commands of the form "a b ." , print the correspoding value.

CONSTRAINTS
  • 0 <= x <=y <= 1000
  • C<=50
  • T<=50


SAMPLE INPUT


5 20 3
0 4 +
4 9 -
3 6 .
100 198 4
4 6 +
0 0 .
0 10 +
3 9 .


Sample Output


18
0
536


Problem Setter: Anjali Singh

Languages: C,C++,Java,PHP

Time Limit: 1 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0