#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int ST = 100010;
const int ST1 = 1000010;
const long long MOD = 1000000007;
long long ABS(long long a) {
  if (a < 0)
    return a * (-1);
  else
    return a;
}
int main() {
  int n, c;
  cin >> n >> c;
  vector<pair<int, int> > p(n);
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    p[i] = make_pair(a, b);
  }
  sort(p.begin(), p.end());
  long long ans = 0;
  for (int i = 1; i < 10000; i++) {
    int dl = 0;
    for (int j = 0; j < n; j++) {
      dl += ((i * p[j].first) / p[j].second) + 1;
    }
    if (dl == c) ans++;
  }
  cout << ans;
}
