ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Неотсортированные > задача:


Rectangles on a plane

Задачи раздела

• Subsets
• The N Queens Problem
• Maximum Sum 2
• Gifts of Santa Claus
• Shopping
• Diameter of graph
• Corridor
• Prime numbers
• Rectangles on a plane
• A. Бактерии
• A. Любимые числа
• A. Рекламный щит
• ASCII Characters
• Area of triangle
• B. basketball
• B. chaotic
• B. Шахматная головоломка

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 1000/1000/1000/1000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

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