Given an array A of N integers, an array B of k integers, find the maximum sum of products of ith element in array B with ith element from corners of array A.
**Note: **We have to select k elements from array A, and we can only select from the corners. The selected element is multiplied by the ith element in array B
Eg:
N=8
k=4
A: 7 3 1 5 2 5
B: 3 1 2 3
Possible sum:
7X3 + 3X1 + 5X2 + 2x3 = 40
5X3 + 3X1 + 1X2 + 5X3= 35