// 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.5600644500543637x):
#include<iostream>

#include<algorithm>

#define rep(i,x,n) for(int i=x;i<n;i++)

#define per(i,x,n) for(int i=n-1;i>=x;i--)

using namespace std;

#define ll long long

//head

int n,L;

int l,r,mid;

struct Bottle

{

    int up,down,val;

    bool operator < (const Bottle a)const

    {

        return val>a.val;

    }

}a[100005];

ll b[100005],c[100005],sum[100005];

bool check(int x)

{

    x--;

    rep(k,1,n+1)

     {

         if(c[k]<=x)continue;

        ll p=L-a[k].up,go=0;

        if(k<=x&&sum[x+1]-a[k].val>=p)return 1;

        if(k>x&&sum[x]>=p)return 1;

    }

    return 0;

}

int main()

{

     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

     int mx=0;

     cin>>n>>L;

     rep(i,1,n+1)cin>>a[i].up>>a[i].down,a[i].val=a[i].up-a[i].down,mx=max(a[i].val,mx);

     if(mx>=L){cout<<1<<endl;return 0;}

     rep(i,1,n+1)cin>>b[i];

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

     rep(i,1,n+1)sum[i]=sum[i-1]+a[i].val;

     ll cnt=1,dis=0;

     rep(i,2,n+1)

     {

         dis+=(a[i].val-b[cnt]);

         if(dis<=0)break;cnt++;

     }

     c[1]=cnt;

     int k=2;

     for(;k<=n;k++)

     {

         if(cnt<k-1||cnt==n)break;

         dis+=(a[k-1].val-a[k].val);

         while(dis>0&&cnt<n)cnt++,dis+=(a[cnt+1].val-b[cnt]);c[k]=cnt;

     }

     for(;k<=n;k++)c[k]=cnt;

     int day=n;rep(i, 1, n+1)if(a[i].val<=0){day=i;break;}//for(int i=1;a[i].val>0&&i<=n;i++,day++);

     l=1,r=day;

     if(l>r){cout<<-1<<endl;return 0;}

     while(l<r)

     {

         mid=(l+r)/2;

         if(check(mid))r=mid;

         else l=mid+1;

     }

     if(check(l))cout<<l<<endl;

     else cout<<-1<<endl;

     return 0;

}