#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  FILE *fp, *fo;
  int n, s, i = 0, x, y, t, sweet, ans = -1;
  cin >> n >> s;
  s = s * 100;
  while (i < n) {
    cin >> x >> y;
    t = 100 * x + y;
    if (t <= s) {
      sweet = (s - t) % 100;
      ans = max(ans, sweet);
    }
    i++;
  }
  cout << ans << "\n";
  return 0;
}
