The first line of the input contains a single integer T (1≤T≤1 200), the number of test cases. Each test case consists of 3 lines.
The first line of each test case contains a single integer N (1≤N≤2⋅105), the number of tasks. The next line contains N integers Ti (1≤Ti≤2⋅1014), the earliest time the ith task can be processed. The 3rd line N integers Di (1≤Di≤109), the period of time the machine takes to finish the ith task. It’s guaranteed that the sum of N over all test cases doesn’t exceed 2 500 000.