#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

The spotlight is back on the Jiahai Potato Farm (JPF) again! The potatoes are all happy with their new WiFi connection and all of a sudden, one of them discovers terrible news! A hurricane is heading in their direction, and there's very little time to take cover! One of them immediately informs Jiahai, and Jiahai is now forced to take measures.

Being an incredibly intelligent farmer, Jiahai has decided to buy a huge blanket that can be used to cover all the potatoes and protect them from the hurricane winds. Given the X and Y coordinates of all the potatoes on the Jiahai Potato Farm, determine the minimum size of the blanket required to cover all the potatoes. The edges of the blanket must be parallel to the X and Y axes and follow along the integer gridlines. NOTE: A potato at a corner of the blanket is considered to be covered.

One possible configuration of JPF is given as follows:

In this case, the blanket will be from (5, 5) to (26, 17), covering an area of 252 units.

There will be *N* potatoes in JPF. You will be given N and two arrays, *X[]* and *Y[]*. (X[0], Y[0]) will be the coordinates of the first potato, (X[1], Y[1]) will be the coordinates of the second potato, etc.

Your program will be required to implement the following functions:

*long long int blanketSize(int N, int X[], int Y[])*, which should return the minimum blanket size needed.

## Limits

Subtask 1 (34%): 1 <=*N*,

*X[i]*,

*Y[i]*<= 1 000

Subtask 2 (66%): 1 <=

*N*,

*X[i]*,

*Y[i]*<= 1 000 000

## Sample Input 1

4 5 5 14 9 26 13 12 17

## Sample Output 1

252

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 34 | 50 | 1s | 32MB | Minimum |

2 | 66 | 50 | 1s | 32MB | Minimum |

3 | 0 | 1 | 1s | 32MB | Minimum |

### Judge Compile Command

g++ grader.cpp ans.cpp -o blanket -Wall -static -O2 -lm -m64 -s -w -std=gnu++14 -fmax-errors=512