| Codeforces Round 1017 (Div. 4) |
|---|
| Finished |
Chimpanzini Bananini stands on the brink of a momentous battle—one destined to bring finality.
For an arbitrary array $$$b$$$ of length $$$m$$$, let's denote the rizziness of the array to be $$$\sum_{i=1}^mb_i\cdot i=b_1\cdot 1+b_2\cdot 2+b_3\cdot 3+\ldots + b_m\cdot m$$$.
Chimpanzini Bananini gifts you an empty array. There are three types of operations you can perform on it.
After each operation, you are interested in calculating the rizziness of your array.
Note that all operations are persistent. This means that each operation modifies the array, and subsequent operations should be applied to the current state of the array after the previous operations.
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases.
The first line of each test case contains an integer $$$q$$$ ($$$1 \leq q \leq 2\cdot 10^5$$$) — the number of operations you perform on your array.
The following $$$q$$$ lines first contain a single integer $$$s$$$ ($$$1 \leq s \leq 3$$$) — the operation type.
It is guaranteed that the sum of $$$q$$$ will not exceed $$$2\cdot 10^5$$$ over all test cases. Additionally, it is guaranteed that the first operation on each test case will be one with $$$s=3$$$.
For each test case, output $$$q$$$ lines, outputting the rizziness of your array after each operation.
1133 13 23 313 423 513 623 721
1 5 14 11 27 23 48 38 74 73 122 102 88
The first six states of the array:
| Name |
|---|


