// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cctype>

#include <cmath>

#include <ctime>

#include <algorithm>

#include <utility>

#include <functional>

#include <string>

#include <vector>

#include <set>

#include <map>

#include <queue>

#include <stack>

#include <bitset>

using namespace std;

typedef long long ll;



const int N = 1e5 + 5, INF = 0x3f3f3f3f;



struct P

{

	ll dif; int id;

	P(ll dif = 0, int id = -1) :dif(dif), id(id) {}

	P operator + (const P &a) const { return P(dif + a.dif, id); }

	bool operator < (const P &a) const { return dif > a.dif; }

};



P p[N];

int n, ans, loc[N];

ll L, a[N], b[N], c[N], d[N];



ll ok(int mid, int i)

{

	if (i <= mid) return p[mid].dif - a[p[i].id] + b[p[i].id];

	return p[mid].dif;

}



int main()

{

	while (~scanf("%d%lld", &n, &L))

	{

		for (int i = 0; i < n; i++)

		{

			scanf("%lld%lld", &a[i], &b[i]);

			p[i] = P(a[i] - b[i], i);

		}

		for (int i = 0; i < n; i++)

		{

			scanf("%lld", &c[i]);

			if (i) c[i] += c[i - 1];

		}

		sort(p, p + n);

		for (int i = 0; i < n; i++)

			loc[p[i].id] = i;

		int fu = n - 1;

		for (; fu >= 0 && p[fu].dif <= 0; fu--);

		for (int i = 1; i < n; i++)

			p[i] = p[i] + p[i - 1];

		ans = INF;

		for (int i = 0; i < n; i++)

		{

			ll len = L - a[i];

			int l = -1, r = fu;

			if (len <= 0) { ans = min(ans, 1); continue; }

			while (r - l > 1)

			{

				int mid = l + r >> 1;

				if (ok(mid, loc[i]) < len) l = mid;

				else r = mid;

			}

			int now = r - (r >= loc[i]), v = ok(r, loc[i]);

			if (v >= len&& v > c[now])

				ans = min(ans, now + 2);

		}

		printf("%d\n", ans == INF ? -1 : ans);

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.6000024376100246x):
#include <bits/stdc++.h>

using namespace std;

const int N = 200005;

struct rec {

	int a,b,d;

};

int s[N],c[N],n,h;

rec a[N];

priority_queue<pair<int,int> > dui1,dui2;

bool cmp(const rec &a, const rec &b){

	return a.d > b.d;

}

int main(){

	scanf("%d%d",&n,&h);

	for (int i = 1; i <= n; i++){

		scanf("%d%d",&a[i].a,&a[i].b);

		a[i].d = a[i].a - a[i].b;

	}

	for (int i = 1; i <= n; i++)

		scanf("%d",&c[i]);

	s[0] = 0;

	for (int i = 1; i <= n; i++)

		s[i] = s[i - 1] + c[i];

	sort(a + 1,a + n + 1,cmp);

//	for (int i = 1; i <= n; i++)

//		printf("%d\n",a[i].d);

//	printf("!!!!\n");

	int len = 1;

	int p = 1;

	int s = 0;

	int ss = a[1].d;

	dui1.push(make_pair(a[1].b,1));

	for (int i = 2; i <= n; i++)

		dui2.push(make_pair(a[i].a,i));

//	printf("!!!!\n");

	while (len <= n){

		if (s > 0 || len == 1){

//			printf("!%d %d %d\n",len,p,s);

			while (! dui1.empty())

				if (dui1.top().second < p)

					dui1.pop();

				else break;

			if ((! dui1.empty()))

				if (dui1.top().first + ss >= h)

					break;

//			printf("!%d\n",len);

			while (! dui2.empty())

				if (dui2.top().second <= len)

					dui2.pop();

				else break;

			if ((! dui2.empty()))

				if (dui2.top().first - a[len].d + ss >= h)

					break;

		}

//		printf("!%d\n",len);

		len++;

		dui1.push(make_pair(a[len].b,len));

//		printf("!! %d\n",s);

		s += a[len].d - c[len - 1];

//		printf("!! %d %d %d %d\n",s,a[len].d,len,c[len - 1]);

		ss += a[len].d;

		while (s <= 0 && p < len){

			s += a[p].d - a[p + 1].d;

			p++;

		}

	}

//	printf("!!!!\n");

	if (len <= n) printf("%d\n",len);

	else printf("-1\n");

}