eolymp
bolt
Try our new interface for solving problems

Water

Recently Sergey went to the well for water but did not return. He took $n$ cans with him, each of which he filled completely with water. Now Sergey wants to deliver them to his country house. This is where the problem lies. At one time Sergey can carry no more than $2$ cans because he has only two hands. Moreover, he can carry no more than $k$ liters of water. Now Sergey stands at the well and thinks about the minimum number of times he can take all the water home, and whether he can do it at all. Help him solve this problem. \InputFile The first line contains two integers $n$ and $k~(1 \le n \le 10^5)$. The second line contains $n$ integers --- the volumes of canisters in liters. All input numbers are positive and do not exceed $10^9$. \OutputFile If Sergey cannot take all the water home, print "\textbf{Impossible}". Otherwise, print one number - the minimum required number of times to go.
Time limit 1 second
Memory limit 128 MiB
Input example #1
4 4
1 2 3 3
Output example #1
3
Author neerc.ifmo.ru
Source Сезон 2008-2009. Цикл интернет-олимпиад для школьников. Седьмая индивидуальная олимпиада. 10 января 2009 года, Задача B