Problem: In the Kingdom of IOI, the wind always blows from sea to land. There are $N + 1$ spots numbered from $0$ to $N$. The wind from Spot $0$ to Spot $N$ in order. Mr. JOI has a house at Spot $N$. The altitude of Spot $0$ is $A_0 = 0$, and the altitude of Spot $i$ ($1 \leq i \leq N$) is $A_i$.

The wind blows on the surface of the ground. The temperature of the wind changes according to the change of the altitude. The temperature of the wind at Spot $0$, which is closest to the sea, is $0$ degree. For each $i$ ($0 \leq i \leq N - 1$), the change of the temperature of the wind from Spot $i$ to Spot $i + 1$ depends only on the values of $A_i$ and $A_{i+1}$ in the following way:

* If $A_i < A_{i+1}$, the temperature of the wind decreases by $S$ degrees per altitude.
* If $A_i \geq A_{i+1}$, the temperature of the wind increases by $T$ degrees per altitude.



The tectonic movement is active in the land of the Kingdom of IOI. You have the data of tectonic movements for $Q$ days. In the $j$-th ($1 \leq j \leq Q$) day, the change of the altitude of Spot $k$ for $L_j \leq k \leq R_j$ ($1 \leq L_j \leq R_j \leq N$) is described by $X_j$. If $X_j$ is not negative, the altitude increases by $X_j$. If $X_j$ is negative, the altitude decreases by $|X_j|$.

Your task is to calculate the temperature of the wind at the house of Mr. JOI after each tectonic movement.

Task

Given the data of tectonic movements, write a program which calculates, for each $j$ ($1 \leq j \leq Q$), the temperature of the wind at the house of Mr. JOI after the tectonic movement on the $j$-th day.

Input

Read the following data from the standard input.

* The first line of input contains four space separated integers $N$, $Q$, $S$, $T$. This means there is a house of Mr. JOI at Spot $N$, there are $Q$ tectonic movements, the temperature of the wind decreases by $S$ degrees per altitude if the altitude increases, and the temperature of the wind increases by $T$ degrees per altitude if the altitude decreases.
* The $i$-th line ($1 \leq i \leq N +1$) of the following $N +1$ lines contains an integer $A_{i-1}$, which is the initial altitude at Spot ($i - 1$) before tectonic movements.
* The $j$-th line ($1 \leq j \leq Q$) of the following $Q$ lines contains three space separated integers $L_j$, $R_j$, $X_j$. This means, for the tectonic movement on the $j$-th day, the change of the altitude at the spots from $L_j$ to $R_j$ is described by $X_j$.



Output

Write $Q$ lines to the standard output. The $j$-th line ($1 \leq j \leq Q$) of output contains the temperature of the wind at the house of Mr. JOI after the tectonic movement on the $j$-th day.

Constraints

All input data satisfy the following conditions.

* $1 \leq N \leq 200 000．$
* $1 \leq Q \leq 200 000．$
* $1 \leq S \leq 1 000 000．$
* $1 \leq T \leq 1 000 000．$
* $A_0 = 0．$
* $-1 000 000 \leq A_i \leq 1 000 000 (1 \leq i \leq N)．$
* $1 \leq L_j \leq R_j \leq N (1 \leq j \leq Q)．$
* $ -1 000 000 \leq X_j \leq 1 000 000 (1 \leq j \leq Q)．$



Sample Input and Output

Sample Input 1


3 5 1 2
0
4
1
8
1 2 2
1 1 -2
2 3 5
1 2 -1
1 3 5


Sample Output 1


-5
-7
-13
-13
-18


Initially, the altitudes of the Spot 0, 1, 2, 3 are 0, 4, 1, 8, respectively. After the tectonic movement on the first day, the altitudes become 0, 6, 3, 8, respectively. At that moment, the temperatures of the wind are 0, -6, 0, -5,respectively.

Sample Input 2


2 2 5 5
0
6
-1
1 1 4
1 2 8


Sample Output 2


5
-35


Sample Input 3


7 8 8 13
0
4
-9
4
-2
3
10
-9
1 4 8
3 5 -2
3 3 9
1 7 4
3 5 -1
5 6 3
4 4 9
6 7 -10


Sample output 3


277
277
322
290
290
290
290
370





Creatie Commons License

The 16th Japanese Olympiad in Informatics (JOI 2016/2017) Final Round





Example

Input

3 5 1 2
0
4
1
8
1 2 2
1 1 -2
2 3 5
1 2 -1
1 3 5


Output

-5
-7
-13
-13
-18

Solution (in CPP):

Solution:
// #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
// #define BEGIN_STACK_EXTEND(size) void * stack_extend_memory_ = malloc(size);void * stack_extend_origin_memory_;char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);*stack_extend_dummy_memory_ = 0;asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
// #define END_STACK_EXTEND asm volatile("mov %%rax, %%rsp"::"a"(stack_extend_origin_memory_));free(stack_extend_memory_);

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<unordered_map>
#include<complex>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-20;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3100000;
const int UF_SIZE = 3100000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
	int UF[UF_SIZE];
	void init_UF(int n){
		for(int i=0;i<n;i++)UF[i]=-1;
	}
	int FIND(int a){
		if(UF[a]<0)return a;
		return UF[a]=FIND(UF[a]);
	}
	void UNION(int a,int b){
		a=FIND(a);b=FIND(b);if(a==b)return;
		if(UF[a]>UF[b])swap(a,b);
		UF[a]+=UF[b];UF[b]=a;
	}
}
// ここから編集しろ
long long p[210000];
int main(){
	int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);
	for(int i=0;i<=a;i++)scanf("%lld",p+i);
	for(int i=0;i<a;i++)p[i]=p[i+1]-p[i];
	long long cur=0;
	for(int i=0;i<a;i++){
		if(p[i]<0)cur-=(long long)d*(p[i]);
		else cur-=(long long)c*(p[i]);
	}
	// printf("%lld\n",cur);
	for(int i=0;i<b;i++){
		int L,R,t;scanf("%d%d%d",&L,&R,&t);
		L--;
		if(p[L]<0)cur+=(long long)d*(p[L]);
		else cur+=(long long)c*(p[L]);
		p[L]+=t;
		if(p[L]<0)cur-=(long long)d*(p[L]);
		else cur-=(long long)c*(p[L]);
		if(R<a){
			if(p[R]<0)cur+=(long long)d*(p[R]);
			else cur+=(long long)c*(p[R]);
			p[R]-=t;
			if(p[R]<0)cur-=(long long)d*(p[R]);
			else cur-=(long long)c*(p[R]);
		}
		printf("%lld\n",cur);
	}
}