문제
Farmer John is not good at multitasking. He gets distracted often, making it hard to complete long projects. Currently, he is trying to paint one side of his barn, but he keeps painting small rectangular areas and then getting sidetracked by the needs of tending to his cows, leaving some parts of the barn painted with more coats of paint than others.
We can describe the side of the barn as a 2D
Farmer John wants to apply several coats of paint to the barn so it doesn't need to be repainted again in the immediate future. However, he doesn't want to waste time applying an excessive number of coats of paint. It turns out that
Problem credits: Nick Wu and Brian Dean
입력
The first line of input contains
Like the rectangles he already painted, any new rectangles that Farmer John paints must have positive area, and their corner points must have
출력
Please output the maximum area of the barn that could be covered by exactly
예제1
3 2
1 1 4 4
3 3 7 6
2 2 8 7
26