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