Magic Towers
Time limit1sMemory limit1024 MB
Given n mages with two towers each, find the area of points where every movement direction brings you closer to both towers of some mage.
Problem
In Bitocja there live n mages, and each of them owns two towers. Each mage can teleport between their two towers, so the other Bitocjans (ordinary citizens) cannot tell which of the two towers a given mage is in.
For reasons that are more or less rational, Bitocjans like to surround themselves with mages. We say a Bitocjan feels safe if they stand at a point such that, no matter which direction they move in, they get closer to one of the mages (regardless of which towers the mages currently occupy). Bitocjans prefer to build their houses only at points where they feel safe. All such points form the safe region.
Find the area of the safe region. It may happen that no point is safe, in which case the area is 0.
Input
The first line contains one integer n (), the number of mages in Bitocja. Each of the next n lines contains four integers (). They mean that the towers of the i-th mage are at the points and . All 2n points in the input are pairwise distinct.
Output
Print one real number, the area of the safe region. The allowed absolute or relative error is . If the exact answer is and you print , the answer is accepted only when .
Hint

The figure below shows the positions of the mage towers (black dots) and the safe region (grey shape). The point is safe. For every direction, there is a mage such that moving from the point in that direction brings it closer to both towers of that mage. The point is not safe. Moving up from it moves away from all towers except the second tower of the fourth mage.