#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s, cos;
  while (~scanf("%d%d", &n, &s)) {
    s *= 100;
    int flag = 0, a, b, ans = 0;
    while (n--) {
      scanf("%d%d", &a, &b);
      cos = a * 100 + b;
      for (int j = 1; cos * j <= s; ++j) {
        flag = 1;
        ans = max(ans, (s - cos) % 100);
      }
    }
    printf("%d\n", flag ? ans : -1);
  }
  return 0;
}
