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