#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s;
  cin >> n >> s;
  s = s * 100;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    a[i] = a[i] * 100 + b[i];
  }
  int otvet = -1;
  for (int i = 0; i < n; i++) {
    if (s >= a[i]) {
      otvet = max(otvet, (s - a[i]) % 100);
    }
  }
  cout << otvet;
}
