#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 100;
const int inf = 1e9 + 4;
const int mod = 1e9 + 7;
const long double EPS = 1e-12;
int n, second, x, y;
int main() {
  cin >> n >> second;
  second *= 100;
  int mx = -1;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    int cur = x * 100 + y;
    if (cur <= second) {
      mx = max(mx, (100 - (cur % 100)) % 100);
    }
  }
  cout << mx;
  return 0;
}
