import java.util.*;
class Cho{
int x;
int y;
Map<Integer,Integer> map;
public Cho(int x,int y) {
this.x = x;
this.y = y;
this.map = new HashMap();
}
}
public class Main{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int K = scan.nextInt();
int max = Integer.MAX_VALUE;
List<Cho> chos = new ArrayList();
for(int i = 0;i < N;i ++) {
Cho cho = new Cho(scan.nextInt(),scan.nextInt());
int minl = cho.x>cho.y?cho.x:cho.y;
for(int l = 1;l <= minl;l ++){
cho.map.put(l, (cho.x/l)*(cho.y/l));
}
chos.add(cho);
if(max > minl &&minl != 0)
max = minl;
}
int res = 0;
for(int i = 1;i <= max;i ++) {
int num = 0;
for(int j = 0;j < chos.size();j ++) {
num += chos.get(j).map.get(i);
}
if (num >= K) {
res = i;
}
}
System.out.print(res);
scan.close();
}
}