You are given two integer vectors of the same length, v1=(x1,x2,…,xn) and v2=(y1,y2,…,yn). The scalar product of the two vectors is the single number x1y1+x2y2+⋯+xnyn.
You may reorder the coordinates of each vector however you like. Permute the coordinates of both vectors so that the scalar product is as small as possible, and print that minimum.