Problem: people live on the coordinate line, the -th one lives at the point (). They want to choose a position to meet. The -th person will spend minutes to get to the meeting place. Also, the -th person needs minutes to get dressed, so in total he or she needs minutes.
Here denotes the absolute value of .
These people ask you to find a position that minimizes the time in which all people can gather at the meeting place.
Input Format: The first line contains a single integer () — the number of test cases. Then the test cases follow.
Each test case consists of three lines.
The first line contains a single integer () — the number of people.
The second line contains integers () — the positions of the people.
The third line contains integers (), where is the time -th person needs to get dressed.
It is guaranteed that the sum of over all test cases does not exceed .
Output Format: For each test case, print a single real number — the optimum position . It can be shown that the optimal position is unique.
Your answer will be considered correct if its absolute or relative error does not exceed . Formally, let your answer be , the jury's answer be . Your answer will be considered correct if .
Note:
- In the -st test case there is one person, so it is efficient to choose his or her position for the meeting place. Then he or she will get to it in minutes, that he or she need to get dressed.
- In the -nd test case there are people who don't need time to get dressed. Each of them needs one minute to get to position .
- In the -th test case the -st person needs minutes to get to position ( minutes to get dressed and minutes on the way); the -nd person needs minutes to get to position ( minute to get dressed and minute on the way); the -rd person needs minutes to get to position ( minutes to get dressed and minutes on the way).