eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Monitoring System

Monitoring System

BCBC is a large bank. To ensure safety, they have set many cameras to monitor the total bank. Recently, they have found some problems in the monitoring system. In the current system, a camera can monitor a rectangle region. Some regions can be monitored by three or more cameras, which is waste; some regions can only be monitored by just one camera, which is not safe. So the manage intends to improve the system. Now he wants to know how many regions are monitored by just two cameras. \includegraphics{https://static.e-olymp.com/content/fa/fa5b5d4bad38a745be279ce16d85ed520ab45e70.jpg} \InputFile There are multiple test cases. Each test case begins with an integer \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{100000}) standing for the number of cameras. Then \textbf{n} lines follow. Each line has four integers \textbf{x_1}, \textbf{y_1}, \textbf{x_2}, \textbf{y_2} (\textbf{1} < \textbf{x_1}, \textbf{x_2}, \textbf{y_1}, \textbf{y_2} < \textbf{10^9}). The four integer descript the rectangle region one camera can monitor, (\textbf{x_1}, \textbf{y_1}) is the left bottom coordinate and (\textbf{x_2}, \textbf{y_2}) is the right up coordinate \OutputFile Each test case output one integer that is the area of regions covered by just exactly two cameras, the result occupied one line.
Лимит времени 10 секунд
Лимит использования памяти 64 MiB
Входные данные #1
3
1 1 3 3
2 2 4 4
1 2 3 4
Выходные данные #1
2
Источник Hunan University 2011 the 7th Programming Contest