You are given two integer arrays A and B, each of length N. Define the function S as follows.
S=A0×B0+A1×B1+⋯+AN−1×BN−1
You may freely rearrange the elements of A, but the elements of B must keep their given order. Write a program that finds the minimum possible value of S.
Input
The first line contains the array length N. The second line contains the N elements of array A in order, and the third line contains the N elements of array B in order.
N is a natural number not greater than 50, and every element of A and B is a non-negative integer not greater than 100.
Output
Print the minimum value of S on the first line.
Hint
To make S as small as possible, pair the largest values of A with the smallest values of B.