A rectangular chip has some defects on its perimeter. We want to locate a
component on the perimeter of the chip as far as possible from the defects.
Specifically, we want to maximize the sum of the distances from the connector
to the defects, where the distance between the component and a defect is
the distance when travelling along the perimeter. (The distance is the shorter
of the counterclockwise or clockwise distances.)
The width of the chip is w and its height is h. Positions are given using a
coordinate system in which the corner opposite the corner (0,0) is (w,h).
Given w and h and double[]s defectw and defecth, return the maximal sum of
distances to our component.
The i-th elements of defectw and defecth give the coordinates of the i-th
defect.
|