#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define int ll

vector<double> a,b;

int lt,rt;
double mas, len;
double m,l,w;
int n,k;

int rh()
{
    if (rt==0)
        return -1;
    double len1,mas1;
    len1=len*mas;
    mas1=mas;
    int i=rt-1;
    len1-=(l+(2*i+1)*w)*b[i];
    mas1-=b[i];
    len1/=mas1;
    if (len1<-l)
        return -1;
    mas=mas1;
    len=len1;
    rt--;
    return 0;
}

int lh()
{
    if (lt==0)
        return -1;
    double len1,mas1;
    len1=len*mas;
    mas1=mas;
    int i=lt-1;
    len1+=(l+(2*i+1)*w)*a[i];
    mas1-=a[i];
    len1/=mas1;
    if (len1>l)
        return -1;
    mas=mas1;
    len=len1;
    lt--;
    return 0;
}

void pre()
{
    len=0,mas=0;
    mas=m;
    for (int i=0; i<n; i++)
        len+=(-l-(2*i+1)*w)*a[i],mas+=a[i];
    for (int i=0; i<k; i++)
        len+=(l+(2*i+1)*w)*b[i],mas+=b[i];
    len/=mas;
    lt=n;
    rt=k;
}

signed main()
{
    cin>>m>>l>>w>>n>>k;
    double x;
    for (int i=0; i<n; i++)
        cin>>x, a.push_back(x);
    for (int i=0; i<k; i++)
        cin>>x, b.push_back(x);

    pre();

    int ans=0;
    int ansx,ansy;
    ansx=-1;
    ansy=0;

    int q=0,p=0;
    int t=0;
    while ((q==0) or (p==0))
    {
        q=0;
        p=0;
        while (lh()!=-1)
            q=1;
        while (rh()!=-1)
            p=1;
        t+=2;
    }
    if (n-rt+k-lt > ansx)
        ansx=n-rt+k-lt,ansy=t;

    pre();
    q=0,p=0;
    t=0;
    while ((q==0) or (p==0))
    {
        q=0;
        p=0;
        while (rh()!=-1)
            q=1;
        while (lh()!=-1)
            p=1;
        t+=2;
    }
    if (n-rt+k-lt > ansx)
        ansx=n-rt+k-lt,ansy=t;




    cout<<ansx<<" "<<ansy<<"\n";
}
