Codeforces Round 849 (Div. 4) |
---|
Finished |
Given an array $$$a_1, a_2, \dots, a_n$$$, you need to handle a total of $$$q$$$ updates and queries of two types:
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of testcases.
The first line of each test case contains two integers $$$n$$$ and $$$q$$$ ($$$1 \le n, q \le 2 \cdot 10^5$$$) — the size of the array and the number of queries, respectively.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$).
The next $$$q$$$ lines of each test case are of two forms:
There is at least one query of the second type.
The sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
The sum of $$$q$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output the answers of queries of the second type, in the order they are given.
35 81 420 69 1434 20231 2 32 22 32 41 2 52 12 32 52 39999 10001 1 22 12 21 112 1
6 15 1434 1 6 7 36 1 1
In the first test case, the following process occurs:
Name |
---|