Cliffs
On the planet Olympia, workers are building a new dam. The construction site is a rectangular area on a plane, measuring 1×L meters, with coordinates set as shown in the figure.
To raise the terrain, magical impulse generators are employed. If a generator with strength H is placed at the X-coordinate p, then for each point q in the segment [p-H; p] on the X axis, the elevation increases by q - p + H meters across the entire width (i.e., for any Z from 0 to 1). Similarly, for each point q in the segment [p; p+H], the elevation increases by H + p - q meters across the entire width. The landscape remains unchanged at other points (see figure). During construction, workers may need to calculate the volume of the dam above a specified rectangle.
Write a program to help the workers with these calculations.
Input
The first line contains two integers: N - the number of operations the workers will perform (1 ≤ N ≤ 100000), and L - the length of the rectangle (1 ≤ L ≤ 100000). The next N lines describe the operations: the first number indicates the operation type, where "1" means placing a magical impulse generator, and "2" means querying a volume. If the operation is "1", two integers p and H follow (0 ≤ p ≤ L; 1 ≤ H ≤ L), indicating a generator with strength H is placed at position p on the X axis. If the operation is "2", two integers A and B follow (0 ≤ A < B ≤ L), indicating a query for the volume of the dam above the rectangle from A to B on the X axis, and from 0 to 1 on the Z axis.
Output
For each operation, output a line with the following information. If the operation is "1", output the number "-1" without quotes. If the operation is "2", output the integer part of the volume of the dam above the rectangle from A to B on the X axis, and from 0 to 1 on the Z axis, as illustrated in the figure.