#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, s, i, x, y, c, _max = -1;
  cin >> n >> s;
  s *= 100;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    c = x * 100 + y;
    if (c > s)
      continue;
    else
      _max = max(_max, (s - c) % 100);
  }
  cout << _max << "\n";
  return 0;
}
