#include <bits/stdc++.h>
using namespace std;
char a[110][110];
int main() {
  int n, s, a, b, s1, s2, max = -1, j, s3;
  cin >> n >> s;
  s1 = s * 100;
  for (int i = 1; i <= n; ++i) {
    cin >> a >> b;
    s2 = a * 100 + b;
    j = 1;
    if (s2 <= s1) {
      if (((s2 * j) % 100) != 0) {
        s3 = 100 - (s2 * j) % 100;
        if (s3 >= max) {
          max = s3;
        }
      } else if (max == -1)
        max = 0;
    }
  }
  cout << max;
  cin >> n;
}
