#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > A;
int main() {
  int n, c;
  cin >> n >> c;
  for (int i = 0; i < n; i++) {
    int first, second;
    cin >> first >> second;
    A.push_back(make_pair(first, second));
  }
  int x = 1;
  int good = 0;
  while (1) {
    int ans = 0;
    for (int i = 0; i < n; i++) ans += 1 + ((x * A[i].first) / A[i].second);
    if (ans == c)
      good++;
    else if (ans > c)
      break;
    x++;
  }
  cout << good << endl;
  return 0;
}
