#include <bits/stdc++.h>
#define ll  long long
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define forn(i,a,b) for(i=a;i<b;i++)
#define rfor(i,a,b) for(i=b-1;i>=a;i++)     // reverse loop
#define yes "YES"
#define no "NO"
#define sorta(a) sort(a.begin(),a.end())
#define rsort(a) sort(a.rbegin(),a.rend())          // reverse sort
#define all(a) a.begin(),a.end()
using namespace std;
//const unsigned int mod = 1000000007;
vector<ll>prime(10000001,1);
vector<ll>sdf(1000001,1);
long long inf=1000000000000000007;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    ll n,x,i;
    cin>>n>>x;
    x=x*100;
    vector<ll >a(n),p(n);
    for(i=0;i<n;i++)
    {
        cin>>a[i]>>p[i];
    }
    long double  ans=0;int f=0;
    for(i=0;i<n;i++)
    {
        ans+=(a[i]*p[i]);
        //cout<<ans<<endl;
        if(ans>x)
            {f=1;break;}
    }


            if(f==1)
                cout<<(i+1)<<endl;
            else
                cout<<-1<<endl;



}



/*
 * Author: Moon_light
 * Solution: 
*/
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define lowbit(x) ((x)&(-x))
#define sz(x) ((int)x.size())
#define fr(x) freopen(x,'r',stdin)
#define fw(x) freopen(x,'w',stdout)
#define mst(x,a) memset(x,a,sizeof(x))
#define all(a) begin(a),end(a)
#define bitcnt(x) (__builtin_popcountll(x))
#define rep(i,a,b) for(int i = (a);i<=(b); ++i)
#define per(i,a,b) for(int i = (a);i>=(b); --i)
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef pair<double,double> PDD;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<double> VB;
typedef double db;

//global variable
const int N = 1;
const int mod = 1e9+7;
int t;


//functions
LL qmi(LL a,LL k,LL mod){
    LL res = 1;
    while(k){
        if(k&1) res = res*a%mod;
        k >>= 1;
        a = a*a%mod;
    }
    return res%mod;
}
int gcd(int a,int b) {
    return b==0? a:gcd(b,a%b);
}

//code from here! Come on! Have a pleasant experience~
int main()
{
    IO;
    int a,b;
    cin>>a>>b;
    int c = a+b;
    int ans = 4;
    if(c >= 15 && b >= 8){
        ans = 1;
    }else if(c >= 10 && b >= 3){
        ans = 2;
    }else if(c >= 3){
        ans = 3;
    }
    cout<<ans<<endl;
    return 0;
}