A higher resolution is required to access the IDE
- 92
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
Detective Sharelock Codes has to inspect a lot of crime scenes. He finds clues scattered around the crime scene, and the location of these clues is diligently recorded by Dr. Watchdog.The good doctor sends the coordinates of all clue locations (Xi Yi) to the detective by email. Sharelock then calculates how many rolls of yellow police line he must purchase in order to protect all of the clues.
Obviously, all clues must be enclosed in a single "ribboned" area, but in addition, all clues must be at least
A roll of ribbon is
Input
Line 1: Number of clues N.
Next N lines: Two space-separated integers for the clue coordinates Xi and Yi in feet.
Next N lines: Two space-separated integers for the clue coordinates Xi and Yi in feet.
Output
Line 1: Number of rolls of yellow police line Sharelock needs in order to surround the crime scene.
Constraints
1≤N≤100000
-100000≤Xi≤100000
-100000≤Yi≤100000
-100000≤Xi≤100000
-100000≤Yi≤100000
Example
Input
3 2794 9725 -183 -1458 -7946 2128
Output
6660
A higher resolution is required to access the IDE