#include <stdio.h>
#include <stdlib.h>

int *zapr, n, m, k, t;
int *kolikoPuta, *vrsta, *vreme;
double *pret, *tren, *temp, *medOdNektara, *vred;

int main() {
	int i,j;
	scanf("%d", &m);

	medOdNektara = (double *)malloc((m+1)*sizeof(double));
	kolikoPuta = (int *)malloc((m+1)*sizeof(int));

	for (i=1; i<=m; i++) {
		scanf("%lf%d", &medOdNektara[i], &kolikoPuta[i]);
	}

	scanf("%d",&n);

	vrsta = (int *)malloc((n+1)*sizeof(int));
	vreme = (int *)malloc((n+1)*sizeof(int));

	for (i=1; i<=n; i++) {
		scanf("%d%d", &vrsta[i], &vreme[i]);
	}

	scanf("%d%d", &k, &t);

	int brpred=0;

	for (i=1; i<=n; i++) {
		brpred += kolikoPuta[vrsta[i]];
	}

	vred = (double *)malloc((brpred+1)*sizeof(double));
	zapr = (int *)malloc((brpred+1)*sizeof(int));

	pret = (double *)malloc((t+1)*sizeof(double));
	tren = (double *)malloc((t+1)*sizeof(double));


	int br=0;
	for (i=1; i<=n; i++) {
		int bristog = kolikoPuta[vrsta[i]];
		for (j=1; j<=bristog; j++) {
			br++;
			vred[br] = k*medOdNektara[vrsta[i]];
			zapr[br] = vreme[i];
		}
	}

	for (i=0; i<=t; i++)
		tren[i] = 0;

	for (i=1; i<=brpred; i++) {
		temp = pret;
		pret = tren;
		tren = temp;

		tren[0] = 0;
		for (j=1; j<=t; j++) {
			if (zapr[i]<=j
				&& pret[j-zapr[i]]+vred[i] > pret[j]) {
					tren[j] = pret[j-zapr[i]]+vred[i];
			}
			else
				tren[j] = pret[j];
		}
	}

	printf("%.2lf\n", tren[t]);
	return 0;
}









