#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s, dollars, cents, maxi(-2147483648), diff, i;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    cin >> dollars >> cents;
    if ((dollars < s) || (dollars == s && cents == 0)) {
      diff = 100 - cents;
      if (diff == 100) diff = 0;
      maxi = max(diff, maxi);
    }
  }
  if (i == n && maxi == -2147483648)
    cout << -1;
  else
    cout << maxi;
}
