Square Stamping
시간 제한1초메모리 제한2048 MB
y좌표가 -9999, 0, 9999인 점들이 주어질 때, 한 변의 길이가 10000인 축에 평행한 정사각형의 최소 개수로 모든 점을 덮는 문제입니다.
문제
In the plane, there are points whose -coordinates are either , , or . Let be the set of these points. Your task is to enclose all the points in by a minimum number of congruent axis-parallel squares of side length . As a subset of the plane, each such square consists of all points inside and on the boundary.
입력
Your program is to read from standard input. The input starts with a line consisting of a single integer (), representing the number of input points in . In each of the following lines, there are two integers and , representing the - and -coordinates of a point in , respectively, such that it holds that and . You may assume that all the input points are distinct.
출력
Your program is to write to standard output. Print exactly one line. The line should consist of a single integer that represents the minimum possible number such that there exist axis-parallel squares of side length whose union encloses all the input points in .