#include <bits/stdc++.h>
int main() {
  int n, s, i, a, b, t, j, v, f, c;
  int candy = -1, d;
  scanf("%d%d", &n, &s);
  s = s * 100;
  while (n--) {
    scanf("%d%d", &a, &b);
    d = (a * 100) + b;
    if (d <= s) {
      f = s - d;
      c = f % 100;
      if (c > candy) candy = c;
    }
  }
  if (c != -1)
    printf("%d", candy);
  else
    printf("-1");
}
