CSES - Book Shop
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are in a book shop which sells nn different books. You know the price and number of pages of each book.

You have decided that the total price of your purchases will be at most xx. What is the maximum number of pages you can buy? You can buy each book at most once.

Input

The first input line contains two integers nn and xx: the number of books and the maximum total price.

The next line contains nn integers h1,h2,,hnh_1,h_2,\ldots,h_n: the price of each book.

The last line contains nn integers s1,s2,,sns_1,s_2,\ldots,s_n: the number of pages of each book.

Output

Print one integer: the maximum number of pages.

Constraints

  • 1n10001 \le n \le 1000
  • 1x1051 \le x \le 10^5
  • 1hi,si10001 \le h_i, s_i \le 1000

Example

Input:

4 10
4 8 5 3
5 12 8 1

Output:

13

Explanation: You can buy books 1 and 3. Their price is 4+5=94+5=9 and the number of pages is 5+8=135+8=13.