The first line contains an integer $T$ ($1 \le T \le 4$), denoting the number of test cases.
For each test case, the first line contains two integers $n,q$ ($1 \le n,q \le 5 \cdot 10^5$), denoting the number of cells in the grid and the number of queries, respectively.
The second line of each test case contains $n$ integers $a_1,a_2,\ldots,a_n$ ($\sum_{i=1}^n |a_i| \le 10^6$).
Each of the following $q$ lines contains integers $l_i,r_i,x_i$ ($1 \le l_i \le r_i \le n$, $0 \le x_i \le 10^{6}$), denoting the parameters of the $i$-th query.