Processing math: 100%
Brewing potion - MarisaOJ: Marisa Online Judge

Brewing potion

Time limit: 1000 ms
Memory limit: 256 MB
Marisa has n mushrooms, ith mushroom has the weight Ai 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 Ai. ### Output - Print a single integers, the minimum number of potion bottles. ### Constraints - 1≤n≤105. - 1≤Ai≤k≤109. ### Example Input: 5712357 Output: 3