Moving Furniture
Time limit2sMemory limit512 MB
Given 4N leg hollow coordinates from N square tables, find the total area of all tables, which the points alone determine.
Problem
Binary Casino has been open nonstop for a long time. The carpet and furniture are badly damaged and look bad, so the casino needs renovation. While the renovation takes place, the four-legged game tables from all game rooms are stored in a storage room.
Your task is not difficult. Your boss asks you to move the game tables back to the exact places where they stood before the renovation. Each game table top is a square, and each table leg is located exactly under a corner of the top. Luckily, the carpet still has small hollows made by the table legs where the tables stood, and you know how many tables were in the room. Your boss does not remember where the tables were placed. The boss does know the total area of all game tables in the room, and insists that this total stays the same.
You must use every hollow in the carpet to place the tables, putting one table leg into each hole. The tables cannot overlap.
Input
The first line contains an integer (), the number of game tables. Then lines follow, each containing two integers and (), the coordinates of a hollow in the carpet. The hollows are listed in arbitrary order, and no two hollows have the same coordinates.
Output
Output a single number: the sum of the areas of all game tables in the room. The answer is correct if it differs from the correct answer by at most .