|All-time Popular Problems|
|Inorder Successor in BST|
|Depth First Traversal for a Graph|
|Delete nodes having greater value on right|
|Column name from a given column number|
|Search an Element in an array|
|Diameter of Binary Tree|
|Get minimum element from stack|
|Subset Sum Problem|
|Reverse words in a given string|
|Reverse a linked list|
Given a array A with N elements and array B with M elements. You have to insert (N-M) zeroes in between array B such that the dot product of array A and array B is maximum.
Definition of Dot Product : A.B = A*B + A*B+....A[N]*B[N].
The first line will contain T which denotes the number of test cases. The first line of each test case will contain integer N and M, denoting the length of array A and array B respectively. The second line of each test case will contain N integers denoting the elements of array A. The third line of each test case will contain M integers denoting the elements of array B.
For each test case, Output the maximized dot product in a new line .
1 2 3