eolymp
bolt
Try our new interface for solving problems
Problems

Four segments

Four segments

Four of the segment given the coordinates of the ends (\textbf{x_1}; \textbf{y_1}) and (\textbf{x_2}; \textbf{y_2}), (\textbf{x_3}; \textbf{y_3}) and (\textbf{x_4}; \textbf{y_4}), (\textbf{x_5}; \textbf{y_5}) and (\textbf{x_6}; \textbf{y_6}), (\textbf{x_7}; \textbf{y_7}) and (\textbf{x_8}; \textbf{y_8}). Determine whether they form a rectangle, if so, compute its area. \InputFile The input data consist of four lines, each of which is placed through the gap \textbf{x} and \textbf{y} coordinates of the endpoints. All coordinates are integers modulo no more than \textbf{100}. \OutputFile Bring out the first line of \textbf{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 \textbf{NO}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1 1 1 2
4 1 1 1
4 2 4 1
4 2 1 2
Output example #1
YES
3.00
Source ГИА 2011 - в.19