#Lutece1183. Segment Game

Segment Game

Migrated from Lutece 1183 Segment Game

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Lillian gets some segments from her fans with lengths of 1,2,3... and she intends to add them to a number line.At the i-th add operation,she will put the segment with length of i on the number line.Every time she put the segment on the line,she will count how many entire segments on that segment.During the operation ,she may delete some segments on the line.

(Segments are mutually independent)

Input

There are multiple test cases.

The first line of the input contains a integer n — the number of operations(1<=n<=2×1051<=n<=2 \times 10^5)

Next n lines contain the descriptions of the operatons,one operation per line.Each operation contains two integers aa, bb.

if aa is 00, it means add operation that Lilian put a segment on the position b(b<109|b|<10^9) of the line. (For the i-th add operation,she will put the segment on [b,b+i] of the line, with length of ii.)

if aa is 11, it means delete operation that Lilian will delete the segment which was added at the b-th add operation.

Output

For i-th case,the first line output the test case number.

Then for each add operation,ouput how many entire segments on the segment which Lillian newly adds.

Samples

3
0 0
0 3
0 1
5
0 1
0 0
1 1
0 1
0 0
Case #1:
0
0
0
Case #2:
0
1
0
2

Note

At the first add operation,Lillian adds a segment [1,2] on the line.

At the second add operation,Lillian adds a segment [0,2] on the line.

At the delete operation,Lillian deletes a segment which added at the first add operation.

At the third add operation,Lillian adds a segment [1,4] on the line.

At the fourth add operation,Lillian adds a segment [0,4] on the line.

Resources

Prepare for 2015 MU2015 Multi-University Training