#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int N = 100010;
int main(void) {
  int n, s;
  cin >> n >> s;
  s *= 100;
  int resp = -1;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    int k = x * 100 + y;
    int diff = s - k;
    if (diff < 0) continue;
    resp = max(resp, diff % 100);
  }
  cout << resp << endl;
  return 0;
}
