#include<bits/stdc++.h>
#define il inline
#define RG register
#define ll long long
#define db double
#define N 200010
#define lowbit (i&-i)
using namespace std;
int l[N],r[N],st[N],a[N],n,m,p1,p2;
ll Ans[N];
namespace BIT{
ll t1[N],t2[N];
void clear(){memset(t1,0,sizeof(t1));memset(t2,0,sizeof(t2));}
void add(int x,int y){
for(int i=x;i<=n;i+=lowbit)t1[i]+=y,t2[i]+=1ll*x*y;
}
void Insert(int l,int r,int num){
add(l,num),add(r+1,-num);
}
ll Query(int pos){
ll Sum(0);
for(int i=pos;i;i-=lowbit)Sum+=(pos+1)*t1[i]-t2[i];
return Sum;
}
ll sum(int l,int r){
return Query(r)-Query(l-1);
}
}
struct event{
int l,r,h,bel,val;
event() {}
event(int a,int b,int c,int d,int e):l(a),r(b),h(c),bel(d),val(e) {}
}eve1[N*2],eve2[N*3];int tot1,tot2;
bool comp(const event & a,const event & b){return a.h<b.h;}
int main(){
scanf("%d%d%d%d",&n,&m,&p1,&p2);
for(int i=1;i<=n;++i)scanf("%d",&a[i]);
for(int i=1;i<=n;++i){
while(st[0]&&a[st[st[0]]]<a[i])r[st[st[0]--]]=i;
st[++st[0]]=i;
}
while(st[0])r[st[st[0]--]]=n+1;
for(int i=n;i;i--){
while(st[0]&&a[st[st[0]]]<a[i])l[st[st[0]--]]=i;
st[++st[0]]=i;
}
while(st[0])l[st[st[0]--]]=0;
for(int i=1;i<=m;++i){int l,r;
scanf("%d%d",&l,&r);Ans[i]+=1ll*(r-l)*p1;
eve1[++tot1]=event(l,r,r,i,1);
eve1[++tot1]=event(l,r,l-1,i,-1);
}
sort(eve1+1,eve1+tot1+1,comp);
for(int i=1;i<=n;++i){
if(l[i]&&r[i]!=n+1)eve2[++tot2]=event(l[i],l[i],r[i],0,p1);
if(l[i]&&r[i]>i+1)eve2[++tot2]=event(i+1,r[i]-1,l[i],0,p2);
if(r[i]!=n+1&&l[i]+1<i)eve2[++tot2]=event(l[i]+1,i-1,r[i],0,p2);
}
sort(eve2+1,eve2+tot2+1,comp);
int h1(1),h2(1);
while(!eve1[h1].h)h1++;
for(int i=1;i<=n&&h1<=tot1;++i){
while(h2<=tot2&&eve2[h2].h==i){
BIT::Insert(eve2[h2].l,eve2[h2].r,eve2[h2].val);
h2++;
}
while(h1<=tot1&&eve1[h1].h==i){
Ans[eve1[h1].bel]+=eve1[h1].val*(BIT::sum(eve1[h1].l,eve1[h1].r));
h1++;
}
}
for(int i=1;i<=m;++i)cout<<Ans[i]<<"\n";
return 0;
}