Book Shop II
Maximum total pages buying at most `k i` copies of each book within budget `x`.
You are in a book shop which sells different books. You know the price, the number of pages and the number of copies 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 several copies of the same book.
Input
The first input line contains two integers and : the number of book and the maximum total price.
The next line contains integers : the price of each book.
The next line contains integers : the number of pages of each book.
The last line contains integers : the number of copies of each book.
Output
Print one integer: the maximum number of pages.
Constraints
Example
Input:
3 10 2 6 3 8 5 4 3 5 2
Output:
28
Explanation: You can buy three copies of book 1 and one copy of book 3. The price is and the number of pages is .
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/BookShopII/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.