Figure 1. A set of 7 rectangles
The corresponding boundary is the whole set of line segments drawn in Figure 2.
Figure 2. The boundary of the set of rectangles
The vertices of all rectangles have integer coordinates.
PICTURE.IN
contains the number of rectangles pasted on the wall.
In each of the subsequent lines, one can find the integer coordinates of the lower left vertex and the
upper right vertex of each rectangle. The values of those coordinates are given as ordered pairs
consisting of an x-coordinate followed by a y-coordinate.
7
-15 0 5 10
-5 8 20 25
15 -4 24 14
0 -6 16 4
2 15 10 22
30 10 36 20
34 0 40 16
This corresponds to the example of Figure 1.
PICTURE.OUT
must contain a single line with a non-negative integer which
corresponds to the perimeter for the input rectangles.
228
This is the contents of the output file for the example above.