CF1184C2 Heidi and the Turing Test (Medium)

题目描述

【问题描述】 定义一个二维球为,以一个点为球心,离球心的曼哈顿距离小于等于半径r的所有点的集合。点(x0,y0)与点(x1,y1)曼哈顿距离为|x0-x1|+|y0-y1|。给定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.