#include <bits/stdc++.h>
using namespace std;
int a[110];
int b[110];
int main() {
  int n;
  int c;
  scanf("%d %d", &n, &c);
  for (int i = 0; i < n; i++) scanf("%d %d", &a[i], &b[i]);
  unsigned long long int cont = 0;
  int current_days = 0;
  for (int i = 1; current_days <= c; i++) {
    current_days = 0;
    for (int j = 0; j < n; j++) current_days += i * a[j] / b[j] + 1;
    cont += (current_days == c);
  }
  cout << cont << endl;
  return 0;
}
