SCORING Test data worth 30 points has ($1 \le X1 < X2 \le 10^{3}$, $1 \le Y1 < Y2 \le 10^{3}$). Test data worth 60 points has ($1 \le X1 < X2 \le 10^{6}$, $1 \le Y1 < Y2 \le 10^{6}$).
Constraints
Test data worth 30 points has ($1 \le X1 < X2 \le 10^{3}$, $1 \le Y1 < Y2 \le 10^{3}$). Test data worth 60 points has ($1 \le X1 < X2 \le 10^{6}$, $1 \le Y1 < Y2 \le 10^{6}$).
Example 1
Input
6 1 2 3 2 2 3 2 5 4 4 6 3 4 2 2 4 4 2 2 6 5 3 3 5 6 5 1 6 6
Output
3 4 0 1
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.