#abc247d. [abc247_d]Cylinder

[abc247_d]Cylinder

您获得了一个队列,有 QQ 次操作,每次操作有以下两种可能:

1 x c:代表将 cc 个数字 xx 弹进队列。

2 c:代表弹出队列前 cc 个数,并输出所有弹出的数的和。

你需要在每次第二种操作后输出正确的答案。保证在进行第二种操作时队列中至少有 cc 个数。

1Q2×1051 \leq Q \leq 2 \times 10^50x1090 \leq x \leq 10^91c1091 \leq c \leq 10^9