#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int a[110], b[110], c[110];
int main() {
  int n, s;
  scanf("%d %d", &n, &s);
  s = s * 100;
  int count = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a[i], &b[i]);
    c[i] = a[i] * 100 + b[i];
    if (s >= c[i]) {
      c[i] = s - c[i];
      c[i] = c[i] % 100;
    } else {
      count++;
      c[i] = 0;
    }
  }
  sort(c, c + n);
  if (count == n)
    printf("%d\n", -1);
  else
    printf("%d\n", c[n - 1]);
  return 0;
}
