#include <bits/stdc++.h>
#define MAX 1000005
#define ll long long
#define upperlimit 1000100
#define INF 1e18
#define eps 1e-12
#define endl '\n'
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define MOD 1000000007LL
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d\n",t)
#define plld(t) printf("%lld\n",t)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>
#define vll vector<ll>
#define clr(a) memset(a,0,sizeof(a))
#define debug(a) printf("check%d\n",a)
#define csl ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll gcd(ll n1,ll n2){
if(n2==0)
return n1;
if(n1%n2==0)return n2;
return gcd(n2,n1%n2);
}
ll powmod(ll base,ll exponent)
{
if(exponent<0) exponent+=MOD-1;
ll ans=1;
while(exponent){
if(exponent&1)ans=(ans*base)%MOD;
base=(base*base)%MOD;
exponent/=2;
}
return ans;
}
int n;
double w,v;
vector<double> x;
double check(double mkc,double t)
{
double ww=mkc/v;
double bc=(t-ww)/w;
bc=ceil(bc);
return bc*w+(x[n-1]-x[0])/v;
}
int main()
{
csl;
cin>>n;
for(int i=1;i<=n;i++)
{
int bb;
cin>>bb;
x.pb(bb);
}
cin>>w>>v;
int q;
cin>>q;
while(q--)
{
double p,t,u;
cin>>p>>t>>u;
int i=lower_bound(x.begin(), x.end(),p)-x.begin();
double ans=min(check(x[i],t+fabs(p-x[i])/u),check(x[i-1],t+fabs(p-x[i-1])/u));
ans=min(ans,t+fabs(x[n-1]-p)/u);
printf("%0.9lf\n", ans);
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgTUFYIDEwMDAwMDUKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSB1cHBlcmxpbWl0IDEwMDAxMDAKI2RlZmluZSBJTkYgMWUxO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