Company: sprinklr_13july
Difficulty: medium
Maximum Products Problem Description You are given two arrays A and B both consisting of N positive integers respectively. For any element A i (1 <= i <= N) of array A, you can select an element B j (1 <= j <= N) and set A i = A i + B j or can set A i = A i * B j . Note that any element of the array B can be used at most once. After at most N operations, what is the maximum product of array A that can be obtained? Input: The beginning of the input starts with a single integer denoting the number of test cases(T). The First line of each test case contains a single integer denoting the value of N. The next line contains N single space-separated A 1 , A 2 , ..., A n positive integers denoting the elements of the array A. The next line contains N single space-separated B 1 , B 2 , ..., B n positive integers denoting the elements of the array B. Output: Print a single integer - The maximum product of the array A after at most N number of operations performed taking mod with 10 9