//#pragma comment(linker,"/STACK:102400000,102400000")
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#define M 40000
using namespace std;
 typedef struct yyyy
 {
     int h;
     double s[5],t[5];
 }yyy;

double h;
double l[3],r[3];
const double pi=acos(-1);
double a[205];
yyy p[3][205];
double eps=1e-6;
int n;
typedef struct nnode
{
    double tt;
    int flag;
}node;
node as[200000];
int tim;

  void cjj(int n)
  {
      int i,j;
      for (i=1;i<=n;i++)
      for (j=1;j<=2;j++)
      {
          double k1,k2;
          double a1,a2;
          double si,co;
          double ll,h;
          double v=a[i];
          double k=v*sqrt(v*v+2*9.8*h)/9.8;
          int flag;
          k1=l[j]/k;
          k2=r[j]/k;
          if (k1>1+eps) {p[j][i].h=0;continue;}
          si=l[j]/k;

          co=sqrt(1-si*si);
          ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
          h=l[j]*9.8/ll;
          if (ll<sqrt(2*9.8*h)+eps) flag=-1;
          else flag=1;

          a1=acos(h/v)*flag;

          co=-sqrt(1-si*si);
          ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
          h=l[j]*9.8/ll;
          if (ll<sqrt(2*9.8*h)+eps) flag=-1;
          else flag=1;

          a2=acos(h/v)*flag;

          if (a1<a2) swap(a1,a2);

          if (k2>1-eps) {p[j][i].h=1;p[j][i].s[1]=a1;p[j][i].t[1]=a2;continue;}
          else
          {
              p[j][i].h=2;
              p[j][i].s[1]=a1;
              p[j][i].t[2]=a2;
          }

          si=r[j]/k;

          co=sqrt(1-si*si);
          ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
          h=r[j]*9.8/ll;
          if (ll<sqrt(2*9.8*h)+eps) flag=-1;
          else flag=1;

          a1=acos(h/v)*flag;

          co=-sqrt(1-si*si);
          ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
          h=r[j]*9.8/ll;
          if (ll<sqrt(2*9.8*h)+eps) flag=-1;
          else flag=1;

          a2=acos(h/v)*flag;

          if (a1<a2) swap(a1,a2);

          p[j][i].s[2]=a2;
          p[j][i].t[1]=a1;

      }



  }

int main()
{
        freopen("in.txt","r",stdin);
        //freopen("out.txt","w",stdout);
        int k,kk;
        int i;
        while(~scanf("%d",&n))
        {
            int c,maxx=0;
            if(n==0)break;
            scanf("%lf%lf%lf%lf%lf",&h,&l[1],&r[1],&l[2],&r[2]);
            for(i=1;i<=n;i++)
            scanf("%lf",&a[i]);

            cjj(n);
            tim=0;
            for(i=1;i<=n;i++)
            {
                a[++tim].tt
            }
        }

        return 0;
}