Mario Party is a classic board game featuring numerous minigames. In this game, pla
You have to answer q independent queries of the following form:
The first line contains an integer T 1≤T≤4), denoting the number of test cases.
For each test case, the first line contains two integers n,q (1≤n,q≤5⋅105), denoting the number of cells in the grid and the number of queries, respectively.
The second line of each test case contains n integers a1,a2,…,an (∑i=1n∣ai∣≤106).
Each of the following q lines contains integers li,ri,xi (1≤li≤ri≤n, 0≤xi≤106), denoting the parameters of the i-th query.
1
5 6
1 -2 3 -4 5
1 5 0
1 5 1
1 5 2
1 5 3
1 5 4
1 5 5
8
5
8
5
6
7