#include <bits/stdc++.h>
using namespace std;
int n, s;
int main() {
  cin >> n >> s;
  int x, y;
  int maxi = 0;
  int f = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    if ((100 * x + y) <= (100 * s)) {
      f = 1;
      maxi = max(maxi, ((100 * s) - (100 * x + y)) % 100);
    }
  }
  if (!f)
    cout << -1;
  else
    cout << maxi;
  return 0;
}
