HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Camp. Turkey > problem:


Rectangles on a plane

Volume problems

• A+B
• Herons
• City Tour
• Workshop
• The N Queens Problem
• Subsets
• Maximum Sum 2
• Gifts of Santa Claus
• Rectangles on a plane
• Permutations
• Reverse permutation
• Nameplates
• Adjacency matrix to edges list
• Edges list to Adjacency matrix
• Cities and roads
• Cycle detection
• Diameter of graph

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/1000/1000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

There are 4 rectangles on a plane surface. Calculate total area that they cover.

Input

There are 16 integer values in 4 lines which absolute value is not bigger than 1000. On each line there are 4 numbers – coordinates of rectangle (left bottom corner and right top corner).

Output

Print total area that they cover.

Example

stdin stdout

2 0 5 2
0 1 3 6
1 3 5 7
4 1 6 5

35

0 0 2 1
0 0 1 2
1 0 2 2
0 1 2 2

4
Для отправки решений необходимо выполнить вход.

www.contester.ru