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