문제
Problem 2: Square Overlap [Brian Dean, 2013]
Farmer John is planning to build N
Given the locations of each of the planned square pastures, please help FJ compute the area shared by the two overlapping pastures. Output zero if no two squares overlap, and -1 if overlap occurs between more than a single pair of pastures.
PROBLEM NAME: squares
입력
* Line 1: Two space-separated integers, N and K. K is guaranteed to be even.
* Lines 2..1+N: Line i+1 contains the integers
출력
* Line 1: The area shared by the two overlapping squares. Output zero if no two squares overlap, and -1 if overlap occurs between more than a single pair of pastures.
예제1
4 6
0 0
8 4
-2 1
0 7
20
INPUT DETAILS:
There are 4 squares, each of size 6 x 6. The first square is centered at
OUTPUT DETAILS:
Pastures #1 and #3 overlap in 20 units of area.