$$$N$$$ piles of stones appeared in your house, and you need to get rid of as many of them as possible. In the $$$i$$$-th pile, there are $$$b_i$$$ black and $$$w_i$$$ white stones.
You may perform the following operations:
What is the minimum total number of stones you can have after performing these operations?
Each test contains multiple test cases. The first line contains the number of test cases $$$T (1 \leq T \leq 10)$$$, the number of test cases. The description of the test cases follows.
The first line of each test case contains one integer $$$N$$$, $$$(3 \leq N \leq 10^5)$$$ - the number of piles.
The second line of each test case contains $$$N$$$ integers $$$b_1 \dots b_N$$$, $$$(0 \leq b_i \leq 10^9)$$$ - the number of black stones in each pile.
The third line of each test case contains $$$N$$$ integers $$$w_1 \dots w_N$$$, $$$(0 \leq w_i \leq 10^9)$$$ - the number of white stones in each pile.
—
Tests in subtasks are numbered from $$$1−20$$$ with samples skipped. Each test is worth $$$\frac{100}{20}=5$$$ points.
Test $$$1-2$$$ satisfy $$$b_1 + b_2 \dots b_N + w_1 + w_2 \dots w_N \leq N-2$$$.
Tests $$$3-7$$$ satisfy $$$b_i = w_i$$$
Tests $$$8-14$$$ satisfy $$$n \leq 10^3, b_i \leq 10^3, w_i \leq 10^3$$$
Tests $$$15-20$$$ satisfy no additional constraints.
For each test case, on a new line, output the minimum number of stones you can have after performing the operations.
431 1 00 0 044 0 0 04 0 0 051 2 4 3 14 2 3 5 150 0 2 1 11 1 2 0 0
1 4 8 5
Problem Idea: Alex_C
Problem Preparation: Alex_C
Occurrences: Advanced J