#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, n, s, mn = 100, f = 0;
  scanf("%d", &n);
  scanf("%d", &s);
  while (n--) {
    scanf("%d", &x);
    scanf("%d", &y);
    x = (x * 100) + y;
    if (x <= s * 100) {
      x = x % 100;
      if (x && x < mn)
        mn = x;
      else if (x == 0)
        f = 1;
    }
  }
  if (mn < 100)
    printf("%d\n", 100 - mn);
  else if (f == 1)
    printf("0\n");
  else
    printf("-1\n");
  return 0;
}
