Four segments
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Four of the segment given the coordinates of the ends (x_1; y_1) and (x_2; y_2), (x_3; y_3) and (x_4; y_4), (x_5; y_5) and (x_6; y_6), (x_7; y_7) and (x_8; y_8). Determine whether they form a rectangle, if so, compute its area.
Input
The input data consist of four lines, each of which is placed through the gap x and y coordinates of the endpoints. All coordinates are integers modulo no more than 100.
Output
Bring out the first line of YES, if the segments form a rectangle, and the second line of its area, rounded off to two decimal places. If these segments do not form a rectangle - in a single line output only word NO.
Examples
Input #1
Answer #1
Submissions 784
Acceptance rate 6%