Description
There is a box with a capacity of V (positive integer, o≤v≤20000), at the same time there are n items (o≤n≤30), each item has a volume (positive integer). Requirements from n items, if thousands of loaded into the box, so that the remaining space for the box is the smallest.
Input
The first line, an integer, represents the box capacity;
The second line, an integer, indicates that there are n items; The next n lines, respectively, represent the respective volumes of the N items.
Output
An integer that represents the remaining space of the box.