All might is the number one hero, but Bakugo doubts his strength. So, to test it, he has given All might a sequence of N stetchable sticks.
Now he has given him Q tasks, each one states that given the original sequence of sticks, stretch(or compress) each stick from Lth stick to Rth stick and make their length equal to K. It takes 1 sec to inc/dec length of a stick and total time is sum of time taken for all the stciks in the given range.
Note: For each task, starting lengths is the initial lengths given by Bakugo.
Input Format:
First line contains N and Q, number of sticks and number of tasks respectively.
Second line contains the lengths of sticks in the order given by Bakugo.
Each of the next Q lines contains L, R and K, denoting the task.
Output Format:
Print output for each task in separate lines.
Constraints:
1≤N,Q≤2∗105
1≤lengths≤106
1≤L,R≤N
1≤K≤106
For first task, initial lengths are {5, 3, 4}.
For second task, initial lengths are {1, 5, 3}.
For this task, initial lengths are {1, 5, 3, 4, 5}.