Dumb Bear Move Package Description:
The stupid bear in the forest is happy today-he bought a new house and moved to move a new home. Therefore, the stupid bear invited a lot of good friends to help move, and prepared a lot of small cartons to carry the goods, but the volume of these cartons are the same, and up to two items can be loaded. However, in order not to disturb too many friends, stupid bear thought of a "smart" approach: make each carton use the most efficient (note: As long as the carton volume is larger than the volume of the sum of the goods is considered to be installed; In order to help the stupid bear to inform friends in advance, please according to the method of the dumb bear, help to calculate: How much is the minimum number of cartons?
Run time limit: Unlimited memory limit: Unlimited input:
Integer v--the volume of the carton, integer n--the total number of items n;
A total of n integers (corresponding to the volume of n items, each integer separated by a space).
Output:
Integer m--minimum number of trays required
Sample Input: Ten 2 2 3 Sample output: 1
Dumb Bear Moving Pack