Problem Statement | |||||||||||||
You are given the coordinates of several vertices in space. Each vertex is colored 'R', 'G' or 'B'. You are to determine the maximum possible area of a triangle such that all three of its vertices are the same color, or all three of its vertices are different colors. You are given a String[] points describing the vertices. Each element of points will be in the form "color x y z", where color is 'R', 'G', or 'B', and x, y, z are integers with no leading zeroes. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
| - | A triangle with all three vertices colinear, or two vertices overlapping, has area 0. | ||||||||||||
| - | Returned value must be within 1.0e-9 absolute or relative error. | ||||||||||||
Constraints | |||||||||||||
| - | points will have between 5 and 50 elements, inclusive. | ||||||||||||
| - | Each element of points will be formatted as "color x y z" (quotes added for clarity). | ||||||||||||
| - | Each color will be 'R', 'G', or 'B'. | ||||||||||||
| - | Each x, y and z will be an integer between 0 and 999, inclusive, with no leading zeros. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||