When travelling to remote locations it is often helpful to carry cash, in case you want to buy something from a seller who does not accept credit or debit cards. It also helps to carry a variety of denominations, in case the seller cannot make change. Even then you may not have the exact amount and will have to pay a little more than the price. The same situation can arise in cities too, for example at a vending machine that returns no change.
You want to minimize the amount you pay, but you must pay at least the price of the item. Among all ways to pay that minimum possible amount, you also want to use as few coins and bills as possible.
The first line contains one integer: the number of test cases that follow.
Each test case begins with a line containing one integer, the price of the item in cents. The price does not exceed 10,000 cents (that is, $100). The next line contains one integer $n$, the number of bills and coins you have, with $n$ at most 100. Each of the following $n$ lines contains one integer, the value in cents of one bill or coin.
The denominations may be any number of cents; they are not restricted to the coins and bills in ordinary use. However, no bill or coin has a value greater than 10,000 cents ($100). The total value of your bills and coins is always at least the price of the item.
For each test case, output a single line with two integers: the total amount paid (in cents) and the total number of coins and bills used.