// Arup Guha
// 3/9/2024
// Solution to Kattis Problem: Financial Planning
// https://open.kattis.com/problems/financialplanning

import java.util.*;

public class financialplanning {

	public static int n;
	public static long[] profit;
	public static long[] cost;
	public static long target;
	
	public static void main(String[] args) {

		// Get basic info.
		Scanner stdin = new Scanner(System.in);
		n = stdin.nextInt();
		target = stdin.nextLong();
		profit = new long[n];
		cost = new long[n];
		
		// Read about all investments.
		for (int i=0; i<n; i++) {
			profit[i] = stdin.nextLong();
			cost[i] = stdin.nextLong();
		}
		
		// Ta da!
		System.out.println(solve());
	}
	
	// Runs binary search and answers the problem.
	public static long solve() {
	
		// We can prove the answer is somewhere in between these two bounds.
		long low = 0, high = 2000000001;
		
		// Run binary search until we converge on an answer.
		while (low < high) {
		
			// Make a guess for # of days.
			long mid = (low+high)/2;
			
			long money = 0;
			
			// Invest!
			for (int i=0; i<n; i++) {
				long curm = profit[i]*mid - cost[i];
				
				// Only invest if this makes us money.
				if (curm > 0) money += curm;
				
				// This is to avoid overflow.
				if (money >= target) break;
			}
			
			// I made enough, so we don't need to invest any more than mid days.
			if (money >= target)
				high = mid;
			
			// Mid isn't enough the smallest the answer could be is mid+1.
			else
				low = mid+1;
		}
		
		// Ta da!
		return low;
	}
}