#include <bits/stdc++.h>
using namespace std;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

int main () {
    int N, X;
    cin >> N >> X;
    int t = 0;
    for (int i = 0; i < N; i++) {
        int v, p;
        cin >> v >> p;
        t += v * p;
        if (t > X * 100) {
            cout << i+1 << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <atcoder/all> // g++ main.cpp -std=c++17 -I .
using namespace std;
// using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(), (v).end()
template<class T,class U> inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){if(x<y){x=y;return true;}return false;}
using ll=long long;

const int inf = INT_MAX / 2; const ll INF = 1LL << 60;
const ll MOD = 1000000007;
// const int MOD = 998244353;

// cout << fixed << setprecision(15) << ans << endl;
// using mint = modint1000000007;

////////////////////////////////////////////////////////////////////////////////////////////


int main() {
  ll n,k;cin>>n>>k;
  if(k<0) k = -k;
  vector<ll> v(2*n-1);
  rep(i, n) {
    v[i] = v[2*n-2-i] = i+1;
  }
  ll ans = 0;
  for(int i = 0; i+k <= 2*n-2; i++) {
    ans += v[i]*v[i+k];
  }
  cout << ans << endl;
}