Problem Statement | |||||||||||||
A parallelogram is a quadrilateral with two sets of parallel sides. You are given three distinct points A(xA,yA), B(xB,yB) and C(xC,yC) in the plane. Consider all non-degenerate parallelograms such that A, B, and C are three of its vertices. Your method should return the difference between the largest and the smallest possible perimeter of such a parallelogram. If there is no such parallelogram, return -1 instead. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | xA, yA, xB, yB, xC and yC will be between -5,000 and 5,000, inclusive. | ||||||||||||
| - | A, B, and C will be three different points. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||
| 4) | |||||||||||||
| |||||||||||||