#B4232. Rectangle Area

    ID: 11889 Type: Default 1000ms 256MiB

Rectangle Area

Rectangle Area

Given four points with coordinates \( (x_1, y_1)\), \( (x_2, y_2)\), \( (x_3, y_3)\), and \( (x_4, y_4)\) where all coordinates are integers, and these points form an axis-aligned rectangle, compute its area. The area of the rectangle can be computed using the formula:

\[ \text{Area} = \left(\max_{1 \le i \le 4} x_i - \min_{1 \le i \le 4} x_i\right) \times \left(\max_{1 \le i \le 4} y_i - \min_{1 \le i \le 4} y_i\right) \]

inputFormat

The input consists of eight integers in a single line: \(x_1\), \(y_1\), \(x_2\), \(y_2\), \(x_3\), \(y_3\), \(x_4\), \(y_4\). These represent the coordinates of the four vertices of an axis-aligned rectangle.

outputFormat

Output a single integer representing the area of the rectangle.

sample

0 0 0 2 3 0 3 2
6