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

//#define TESTPATH "D:\\Work\\C2\\Debug\\"
#define TESTPATH ""

int total_peaces;
int min_used = 1000;
int finx, finy;

int x0, y0;

int k;
int L[40], C[40];

int usedC[50];

int __fastcall __abs(int t)
{
	return t > 0 ? t : -t;
}

int main(void)
{
	FILE * inf = fopen(TESTPATH"input.txt", "rt");
	FILE * outf = fopen(TESTPATH"output.txt", "wt");
	
	int i,j;

	fscanf(inf, "%d", &x0);
	fscanf(inf, "%d", &y0);
	fscanf(inf, "%d", &finx);
	fscanf(inf, "%d", &finy);
	fscanf(inf, "%d", &k);

	for (i = 0; i < k; i++) fscanf(inf, "%d", &L[i]);
	for (i = 0; i < k; i++) fscanf(inf, "%d", &C[i]);

	for (i = 0; i < k; i++) usedC[i] = -C[i];

	int diffX = finx - x0;
	int diffY = finy - y0;

	if (diffX == 0 && diffY == 0) {
		fprintf(outf, "%d", -1);
		fclose(inf);
		fclose(outf);
		return 0;
	}

	//Search X
	while (usedC[k] == 0) {
		int len = 0;
		for (i = 0; i < k; i++) len += L[i] * usedC[i];

		if (len == diffX) {
			//Search Y:
			int yUsedC[50];
			int yC[40];

			for (i = 0; i <= k; i++) yUsedC[i] = 0;
			for (i = 0; i < k; i++) yC[i] = __abs(C[i]) - __abs(usedC[i]);
			for (i = 0; i < k; i++) yUsedC[i] = -yC[i];

			while(yUsedC[k] == 0) {
				int len = 0;
				for (i = 0; i < k; i++) len += L[i] * yUsedC[i];

				if (len == diffY) {
					//count total used
					int total_used = 0;

					for (i = 0; i < k; i++) total_used += __abs(usedC[i]) + __abs(yUsedC[i]);
					if (total_used < min_used) min_used = total_used;
					
				}

				yUsedC[0]++;
				for (i = 0; i < k; i++) {
					if (yUsedC[i] > yC[i]) {
						yUsedC[i] = -yC[i];
						yUsedC[i+1]++;
					}
				}
			}
		}

		usedC[0]++;
		for (i = 0; i < k; i++) {
			if (usedC[i] > C[i]) {
				usedC[i] = -C[i];
				usedC[i+1]++;
			}
		}
	}
	
	if (min_used <= 40 && min_used > 0) {
		fprintf(outf, "%d", min_used);
	} else {
		fprintf(outf, "%d", -1);
	}

	fclose(inf);
	fclose(outf);
	return 0;
}