#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n;
  cin >> n >> s;
  int A[n][2];
  int cents[n];
  for (int i = 0; i < n; i++) {
    cin >> A[i][0] >> A[i][1];
    cents[i] = A[i][0] * 100 + A[i][1];
  }
  int ans = -1;
  int have = s * 100;
  for (int i = 0; i < n; i++) {
    if (have >= cents[i]) {
      int change = have - cents[i];
      change %= 100;
      ans = max(change, ans);
    }
  }
  cout << ans << endl;
  return 0;
}
