Brewing potions - MarisaOJ: Marisa Online Judge

Brewing potions

Time limit: 1000 ms
Memory limit: 256 MB
Marisa has $n$ mushrooms, $i^{th}$ mushroom has the weight $A_i$ and now she want to make some potions. A potion can be made from no more than $2$ mushrooms and their weight cannot exceed $k$. What is the minimum number of potion bottles she can make using all $n$ mushrooms (because it is easier to carry along)? ### Input - The first line contains 2 integers $n, k$. - The second line contains $n$ space-separated integers $A_i$. ### Output - Print a single integers, the minimum number of potion bottles. ### Constraints - $1 \le n \le 10^5$. - $1 \le A_i \le k \le 10^9$. ### Example Input: ``` 5 7 1 2 3 5 7 ``` Output: ``` 3 ```