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