The Largest Circle

You are given the Cartesian coordinates of four corners of a room which has the shape of a parallelogram. You will have to find the area of the largest circle that fits inside it. Input The input file contains 20000 test cases. The description of each test case is given below. The input for each test case is given in a single line. This line contains eight integers x1, y1, x2, y2, x3, y3, x4, y4. (−1000 ≤ x1, y1, x2, y2, x3, y3, x4, y4 ≤ 1000). These four integers actually denote that the coordinates of the four corners of the room are (x1, y1), (x2, y2), (x3, y3) and (x4, y4) (In clockwise or counter clockwise order). The room always has the shape of a parallelogram. Input is terminated by a case where all eight values are zero. Output For each line of input produce one line of output. This line contains the area of the largest circle that fits in the given room. The area should be printed in the form ‘(a/b)*pi’ (representing a/b ∗ π, where a and b are relative prime integers and π is the ratio of circumference and diameter of a circle). If it is not possible to express the result in this format then output a ‘-1’ instead. Sample Input 0 0 10 0 10 10 0 10 00000000 Sample Output (25/1)*pi