Submit solution

Points:
7 (partial)

Time limit:
1.0s

Memory limit:
32M

Authors:

Problem type

Allowed languages

Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, ~~CommonLisp~~, D, Dart, F#, Forth, Fortran, Go, ~~Groovy~~, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, ~~Nim~~, ~~ObjC~~, OCaml, ~~Octave~~, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Josh is playing his favorite game, Legal Legends. In the game, Josh has to command and select units, by drawing a rectangle that contains them. On Josh's screen, there are units, with the unit having the coordinates , Josh is lazy, and does not want to draw larger rectangles than he needs to. Help Josh figure out the minimum area of the rectangle required to contain all the units on his screen. A unit is considered contained in a rectangle if it is either inside the rectangle, or on one of its edges.

#### Input Specification

The first line will contain the integer , the number of units on Josh's screen. The next lines contains integers each, the line containing , , the coordinates of the unit.

#### Output Specification

Output the minimum area required to contain Josh's units.

#### Sample Input 1

```
4
0 2
0 0
2 0
2 2
```

#### Sample Output 1

`4`

#### Sample Input 2

```
3
1 2
1 3
1 4
```

#### Sample Output 2

`0`

## Comments

This question is almost exactly the same as VM7WC '16 #3 Bronze - Shahir-in-a-Box, which is worth three points.

However, the rectangles in that problem must be axis-aligned, whereas in this problem there is no such constraint.