On a serene seaside, jellyfish communicate with the shore using unique pulsating signals. These signals are of two types:
The first line contains $$$N (1\leq N\leq 2\cdot 10^5)$$$, the number of jellyfish signals received by the shore.
The next $$$N$$$ lines describe each of these signals:
It's also guaranteed that all $$$x$$$ are distinct.
For each type 1 query, print the answer on a new line. Print the number of continuous luminous dances, followed by a space, and then the intensity (sum) of all the luminuous dance intensities that are continuous for the interval $$$[l, r]$$$.
60 1 21 1 40 3 41 1 40 2 31 1 4
1 2 2 6 1 9
30 1 10 2 11 1 1
-1 -1
100 10 681 3 91 3 40 3 91 1 80 4 700 9 351 1 80 2 550 1 1
-1 -1 -1 -1 1 9 1 79
For the first sample, let's denote the first 5 elements by index [1, 2, 3, 4, 5]. Then, the state after each 0 query will be:
For the first query, we can see that there is one dance with intensity 2, so we print out 1 2
For the second query, we can see that there are two dances with total intensity 6, so we print out 2 6
For the third query, since dance $$$[2, 3, 4]$$$ is fully contained, but now there is one continuous dance, so we print 1 9