# Arup Guha
# 4/5/2025
# Solution to Kattis Problem: Financial Planning
# Illustrates integer binary search.
# https://open.kattis.com/problems/financialplanning

# Returns the profit for days worth of investing on the set of investments.
def profit(investments, days):

    # Accumulator variable
    mymoney = 0

    # Loop through the investments.
    for x in investments:

        # Only invest if we turn a profit in this many days.
        if days*x[0] > x[1]:
            mymoney += (days*x[0] - x[1])

    # This is my max profit for investing days # of days.
    return mymoney

# Uses binary search to find the fewest days to get to our goal.
def solve(investments, money):

    # Based on problem description, this is safe.
    low = 0
    high = 2000000005

    # How to do an integer binary search.
    while low < high:

        # Halfway in between.
        mid = (low+high)//2

        # This is how much money I make in mid # of days.
        mymoney = profit(investments, mid)

        # I made enough the real answer is mid or lower.
        if mymoney >= money:
            high = mid

        # I didn't make enough, so answer is strictly greater than mid.
        else:
            low = mid+1

    # Ta da!
    return low

        
# Get basic input.
toks = input().split()
n = int(toks[0])
money = int(toks[1])
investments = []

# Get investments.
for i in range(n):
    investments.append([int(x) for x in input().split()])

# Ta da!
print(solve(investments, money))

                    
