#P2376. [USACO05OCT] Allowance S / [USACO09OCT] Allowance G

[USACO05OCT] Allowance S / [USACO09OCT] Allowance G

Description

As a reward for setting a milk production record, Farmer John decides to give Bessie a weekly allowance.

FJ has some coins, with N(1N20)N (1 \le N \le 20) different denominations. Each denomination divides all larger denominations.

Using the given collection of coins, he wants to give Bessie at least C(1C100000000)C (1 \le C \le 100000000) each week. Please compute the maximum number of weeks he can make such payments.

Input Format

Line 11: Two space-separated integers: NN and CC.

Lines 22 to N+1N+1: Each line contains two integers describing one coin denomination: the coin value V(1V100,000,000)V (1 \le V \le 100,000,000) and the number of coins of that denomination B(1B1,000,000)B (1 \le B \le 1,000,000).

Output Format

Line 11: A single integer, the maximum number of weeks he can pay an allowance of at least CC.

3 6
10 1
1 100
5 120
111

Hint

FJ can overpay Bessie with the one 1010-cent coin for 11 week, then pay Bessie two 55-cent coins for 1010 weeks and then pay Bessie one 11-cent coin and one 55-cent coin for 100100 weeks.