Plastics are plastic, everyone knows that. But the fact that not all plastics possesses the
same plasticness is lesser known. For example, plastic bags have a plasticness of $69$, and
straws have a plasticness of $420$.
Letser, an anti-environmentalist, decided to destroy the ecology of the world by binge buying
very plastic products. A product is very plastic if and only if its plasticness
is not smaller than $69$. Therefore, plastic bags and straws are very plastic.
However, notwithstanding being born with a silver spoon in his mouth, letser cannot afford all
plastic products. Therefore, as Letser's friend, please help him decide what's the maximum number of plastic products
he could buy. Letser could purchase each product at most once as he thinks that buying the same
plastic multiple times is not plastic enough.
Input
The first line of the input contains two integers $N$ and $X,$
representing the number of plastic products in the world and the amount of money that Letser has.
The second line of the input contains $N$ integers $p_1, p_2, \dots, p_N,$ the plasticnesses of the
$N$ products.
The third and final line of the input contains $N$ integers $c_1, c_2, \dots , c_N,$ the costs of the
$N$ products.
Output
Output one integer, the maximal number of products that Letser could buy.
Constraints
Subtask 1 (30%): $1 \le N \le 10$, $1 \le X, c_i, p_i \le 10$.
Subtask 2 (40%): $1 \le N \le 1000$, $1 \le X, c_i, p_i \le 1000$.
Subtask 3 (30%): $1 \le N \le 10^6$, $1 \le X, c_i, p_i \le 10^{18}$.
Sample Test Cases
Input | Output | |
---|---|---|
4 5 68 69 70 71 1 2 3 4 |
2 |
Scoring: Per Subtask
Authored by s17r28
Appeared in 2022 Plastic Contest