Bounding Box
Print the area of the smallest axis-aligned rectangle containing all N points (0 if they are collinear on an axis-parallel line).
Input: the first line has N; the next N lines each have x y.
Output: (max x − min x) · (max y − min y).
Constraints:
- 1 ≤ N ≤ 5×104
- |coordinates| ≤ 106
Sample Tests
Input 1
3 1 1 4 5 2 3
Output 1
12
Input 2
1 7 7
Output 2
0
Discussion (opens after you solve — no spoilers before)
No comments yet.