Gregory and the Bank

Given fixed incoming and outgoing amounts plus a schedule of receiving and sending days, assign each transfer to a day to maximize suppliers paid.

Medium7GreedySortingArrayNo attempts yetTime limit2sMemory limit256 MB

Problem

Gregory works in the accounting office of a large company. He receives money from the company's clients by wire transfer and sends money to the company's suppliers by wire transfer.

Every transfer goes through the only bank branch in the city, and that branch keeps an unusual schedule. Each day it allows exactly one kind of operation, so on some days only incoming transfers are possible and on other days only outgoing ones. Gregory can handle at most one transfer per day, and it must be the kind the branch allows that day. He chooses the other party of each transfer himself. His boss dislikes seeing him idle, so Gregory has to visit the bank every day and attempt a transfer.

Gregory must process nn requests to receive money from clients and mm requests to send money to suppliers. He knows the branch schedule in advance, so he sets the transfer day for every client and every supplier. The schedule has exactly nn receiving days and exactly mm sending days, so each request is assigned to its own day.

The account Gregory manages starts with a balance of 0. On a receiving day the amount of the client he assigned to that day is added to the balance. On a sending day he sends that amount to the supplier he assigned to that day, but if the balance is smaller than the amount, the transfer is cancelled. No money leaves the account and Gregory gets a rebuke. That supplier refuses to continue working with the company, so the payment cannot be made on a later day either.

Find an assignment that minimizes the number of suppliers Gregory fails to pay.

Input

The first line contains the number of test cases tt (1t10001 \le t \le 1000).

Each test case is given in the following format. The first line contains the number of clients nn and the number of suppliers mm (1n,m1001 \le n, m \le 100). The second line contains nn integers aia_i (1ai10001 \le a_i \le 1000), where aia_i is the amount the ii-th client sends to Gregory's company. The third line contains mm integers bjb_j (1bj10001 \le b_j \le 1000), where bjb_j is the amount that must be sent to the jj-th supplier. The fourth line contains a string ss of length n+mn + m consisting of nn characters + and mm characters -. If the kk-th character of ss is +, the bank allows receiving money on day kk; if it is -, the bank allows sending money on day kk.

Output

For each test case, print the minimum number of suppliers Gregory does not send money to, one per line.