luogu#P3717. [AHOI2017初中组] cover

[AHOI2017初中组] cover

Background

The following is a simplified version that does not change the meaning of the problem.

Problem Description

On an n×nn\times n grid (indexed from 11), there are mm detectors, each with a detection radius rr. Among these n×nn\times n points, how many points can be detected.

Input Format

The first line contains 33 integers n,m,rn,m,r. Each of the next mm lines contains two integers x,yx,y, representing the coordinates of the ii-th detector.

Output Format

Output the number of points that can be detected.

5 2 1
3 3
4 2
8

Hint

Constraints: 1n,m1001\le n,m\le 100.

Translated by ChatGPT 5