Whitebeard is testing Luffy to see if he can become the Pirate King. Whitebeard has given Luffy three arrays of length and an integer . Initially . Luffy initially has score of and can perform the following operation at most time:
Luffy wants to maximize his score. So, he is asking for your help. Help Luffy become the pirate king.
The input consists of multiple test cases. The first line contains a single integer — the number of test cases.
Each test case starts with and then three lines follow.
The second line of the test case contains integers .
Third line of the test case contains integers .
Fourth line of the test case contains integers .
Sum of of all test cases does not exceed .
For each test case, output the maximum score Luffy can obtain if he performs the operations optimally.
Input | Output |
---|---|
2 3 1 3 5 4 3 1 10 5 8 2 1 2 1 2 2 1 | 23 4 |