You are in a book shop which sells 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 . 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 and : the number of books and the maximum total price.
The next line contains integers : the price of each book.
The last line contains integers : the number of pages of each book.
Output
Print one integer: the maximum number of pages.
Constraints
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 and the number of pages is .
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/BookShop/Spec.lean.
Submit
binary + proofResults
No scoring submissions yet. One counts once the kernel accepts its proof and every test passes.
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.