#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, s, n, a, b, f = 0, maxx = -1;
  scanf("%d%d", &n, &s);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &a, &b);
    if (a * 100 + b <= s * 100) {
      f = 1;
      if (b != 0) maxx = max(maxx, 100 - b);
    }
  }
  if (maxx > -1)
    printf("%d\n", maxx);
  else if (!f)
    puts("-1");
  else
    puts("0");
}
