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