Write efficient C++ code for the following program.Also explain your logic You are given two sequences A
Fantastic news! We've Found the answer you've been seeking!
Question:
Write efficient C++ code for the following program.Also explain your logic
You are given two sequences A1,A2,…,AN and B1,B2,…,BN. You should choose a permutation P1,P2,…,PN of the integers 1 through N and construct N rectangles with dimensions A1×BP1,A2×BP2,…,AN×BPN Then, for each of these rectangles, you should construct an inscribed circle, i.e. a circle with the maximum possible area that is completely contained in that rectangle.
Let S be the sum of diameters of these N circles. Your task is to find the maximum value of S.
Related Book For
Posted Date: