Company: sprinklr_13july
Difficulty: medium
Maximum Products Problem Description You are handed two arrays, A and B, each holding N positive integers. For any position i (1 <= i <= N) in array A, you may pick some unused position j (1 <= j <= N) in array B and either add B j onto A i (A i = A i + B j ) or multiply A i by B j (A i = A i * B j ). Each entry of B may be spent on at most one such operation. Performing no more than N operations in total, what is the largest possible product of every element of A? Input: The input opens with a single integer giving the number of test cases (T). Each test case starts with a line holding a single integer N, followed by a line of N space-separated positive integers A 1 , A 2 , ..., A n making up array A, and then a line of N space-separated positive integers B 1 , B 2 , ..., B n making up array B. Output: For each test case, print a single integer giving the maximum attainable product of array A after at most N operations, reduced modulo 10 9 + 7 (=1000000007). Examples Examp