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