#include <fstream>
#include <algorithm>
using namespace std;
ifstream in("lapte.in");
ofstream out("lapte.out");
const int NMAX = 102;
struct bautor{
int x,y;
}V[NMAX];
int N, C;
inline bool cmp(const bautor&a, const bautor&b){
return a.x*b.y < b.x*a.y;
}
bool tryToDrink(int time){
int C1 = C, C2 = C, dif;
for(int i = 0; i < N; i++){
if(C1 > 0) {
C1 -= time/V[i].x;
dif = time%V[i].x;
if(C1 < 0){
dif += (-C1)*V[i].x;
C1 = 0;
}
C2 -= dif/V[i].y;
}
else {
C2 -= time/V[i].y;
}
}
if(C1 <= 0 && C2 <= 0){
return true;
}
else {
return false;
}
}
int searchMinValue()
{
int i, step;
for (step = 1; step < 10000; step <<= 1);
for (i = 0; step; step >>= 1)
if (i + step < 10000 && tryToDrink(i+step) == false)
i += step;
while(!tryToDrink(i))
i++;
while(tryToDrink(i))
i--;
return i+1;
}
int main()
{
int i;
in >> N >> C;
for(i = 0; i < N; i++){
in >> V[i].x >> V[i].y;
}
sort(V,V+N,cmp);
out << searchMinValue();
return 0;
}