A game is played by putting beads into boxes. The full rules are too long to repeat here. Only one thing matters for the outcome: you have to keep track of how many beads sit in a run of adjacent boxes.
A friend asked you to write a program that helps him win every game. At the start of a game every box is empty.
The first line contains T, the number of games played. Each game begins with a line holding B, P and Q: the number of boxes, the number of put requests, and the number of query requests.
Then follow P+Q lines. Each line is either P i a, meaning a beads are put into box i, or Q i j, asking how many beads are in boxes i through j at that moment. Both end boxes belong to the range.
P i a, 0<i≤B.Q i j, 0<i≤j≤B.For each query request, print the total number of beads in boxes i through j at that point of the game, one number per line.