Batman is assigning the night surveillance activities for himself and Robin. Batman will assign a convex area of the plane to himself, and another convex area to Robin. To avoid jurisdictional problems, assigned areas must not intersect or touch each other. The surveilled area is then the union of the area surveilled by Batman and the area surveilled by Robin. There are several conflictive points in the city that need to be patrolled, so the assignment Batman will do needs to make sure all those points lay within the surveilled area or on its boundary.
Night surveillance is a very time and power consuming task. The power needed by either Batman or Robin to do the surveillance of a given area, measured in bat-units, is exactly the surface of the area. Batman is very lazy and wants to consume the minimum of his own power, but he does not care about Robin's consumption. However, since he is the most experienced and the leader of the team, and in order to keep Robin from suspecting he is lazy, he never assigns to Robin an area strictly larger than the area he assigns to himself.
You will be given the set of conflictive points in two integer arrays. The X coordinate of conflictive point i will be given by element i of x, and the Y coordinate by element i of y. Return the minimum power Batman will need for a night of surveillance if he optimizes the assignment of the areas.
|Method signature:||double minArea(int x, int y)|
|(be sure your method is public)|
|-||A convex area is a set S of points in the plane such that if two points belong to S, the segment that connects them is fully contained in S.|
|-||The returned value must have an absolute or relative error less than 1e-9.|
|-||x and y will contain the same number of elements.|
|-||The number of elements in x will be between 1 and 50, inclusive.|
|-||Each element of x and y will be between -1000 and 1000, inclusive.|
|-||Each represented point will be different.|
|This area can be partitioned into two small squares of size 100.|
|Both Batman and Robin can be assigned an area as small as Batman wants and still cover the necessary points.|
|Note that areas cannot overlap, and Batman gets stuck with the center point while Robin has a minimal surveillance area.|