Book Shop
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
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 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.
Examples
Input #1
Answer #1
Note
You can buy books and . Their price is and the number of pages is .
Submissions 89
Acceptance rate 38%