As is known, the airline "Trouble" often loses luggage, and concerned journalists decided to calculate the maximum number of luggage pieces that may not return to travelers.
The airline "Trouble" operates flights between $$$n$$$ airports, numbered from $$$1$$$ to $$$n$$$. The journalists' experiment will last for $$$m$$$ days. It is known that at midnight before the first day of the experiment, there were $$$s_j$$$ lost pieces of luggage in the $$$j$$$-th airport. On the $$$i$$$-th day, the following occurs:
For each $$$k$$$ from $$$1$$$ to $$$m$$$, the journalists want to know the maximum number of lost pieces of luggage that may be unfound during the checks over the first $$$k$$$ days. Note that for each $$$k$$$, these values are calculated independently.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$3 \le n \le 12$$$, $$$1 \le m \le 2000$$$) — the number of airports and the number of days of the experiment.
The second line of each test case contains $$$n$$$ integers $$$s_1, s_2, \ldots, s_n$$$ ($$$0 \le s_i \le 10^8$$$) — the initial number of lost pieces of luggage in each airport.
Next, the descriptions for each of the $$$m$$$ days follow in order.
The first line of the description of the $$$i$$$-th day contains $$$n$$$ integers $$$a_{i,1}, a_{i,2}, \ldots, a_{i,n}$$$ ($$$0 \le a_{i, j} \le 10^8$$$) — the maximum number of lost pieces of luggage that can be transported to the previous airport for each airport.
The second line of the description of the $$$i$$$-th day contains $$$n$$$ integers $$$b_{i,1}, \ldots, b_{i,n}$$$ ($$$0 \le b_{i, j} \le 10^8$$$) — the minimum number of lost pieces of luggage that will be found on the $$$i$$$-th day in each airport.
The third line of the description of the $$$i$$$-th day contains $$$n$$$ integers $$$c_{i,1}, \ldots, c_{i,n}$$$ ($$$0 \le c_{i, j} \le 10^8$$$) — the maximum number of lost pieces of luggage that can be transported to the next airport for each airport.
It is guaranteed that the sum of $$$m$$$ over all test cases does not exceed $$$2000$$$.
For each test case, output $$$m$$$ integers — the maximum number of unfound pieces of luggage for each number of days from $$$1$$$ to $$$m$$$.
25 31 1 1 1 10 0 1 0 00 1 0 0 11 0 0 1 00 1 0 0 09 0 9 9 90 1 0 0 00 0 0 0 09 0 9 0 00 0 0 0 03 10 100000000 50 100000000 50 100000000 50 100000000 5
5 4 2 100000005
In the first test case:
The found luggage is marked in green. In the second test case, all pieces of luggage may remain in their original airports, and the inspection won't find any lost suitcases. Therefore, the answer is $$$10^9 + 5$$$.