Camping season is here. A trip needs all sorts of gear, and you carry that gear yourself, so deciding what you really need matters. The gear is already picked out, so the only thing left is to pack it into backpacks.
One backpack takes any number of items, as long as their total weight does not exceed its capacity. Items cannot be split, so part of the capacity you buy may go unused.
The catch is that you own no backpacks yet and have to buy them. The shop sells backpacks of several capacities, and they all cost the same. Buy enough backpacks to hold every item while spending as little as possible.
The first line contains the number of items to pack, n, and the number of backpacks in the shop, m. (1≤n≤24, 1≤m≤100)
The second line contains n integers a1,a2,…,an. The value ai is the weight of the i-th item. (1≤ai≤108)
The third line contains m integers c1,c2,…,cm. The value ci is the capacity of the i-th backpack. (1≤ci≤108)
Print on the first line the minimum number of backpacks that hold every item. If packing every item is impossible, print the word NIE instead.
In the first example you can buy the first backpack and the third backpack. The heaviest item goes into the backpack of capacity 11, and the remaining items go into the backpack of capacity 9.