CF1184C2 Heidi and the Turing Test (Medium)

题目描述

【问题描述】 定义一个二维球为,以一个点为球心,离球心的曼哈顿距离小于等于半径 $r$ 的所有点的集合。点 $(x_0,y_0)$ 与点 $(x_1,y_1)$ 曼哈顿距离为 $|x_0-x_1|+|y_0-y_1|$。给定 $n$ 个点,和 $r$ 输出二维球覆盖的最多点数。

输入格式

输入的第一行包含 $n,r$ 接下来 $n$ 行每行两个整数 $x,y$ 表示点的坐标

输出格式

输出的第一行包含一个数表示最多点数

说明/提示

In the first example, a ball centered at $ (1, 0) $ covers the points $ (1, 1) $ , $ (1, -1) $ , $ (2, 0) $ . In the second example, a ball centered at $ (0, 0) $ covers all the points. Note that $ x_0 $ and $ y_0 $ need not be integer.