logo AlgoBeat OnlineJudge
登录 注册

#207483. [ICPC 2020 WF] Ley Lines

内存限制:1024 MiB 时间限制:15000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

ICPC2020 WF F


In 1921, the amateur archaeologist Alfred Watkins coined the term "ley lines" to refer to straight lines between numerous places of geographical and historical interest. These lines have often been associated with mysterious and mystical theories, many of which still persist.

One of the common criticisms of ley lines is that lines one draws on a map are actually of non-zero width, and finding "lines" that connect multiple places is trivial, given a sufficient density of points and a sufficiently thick pencil. In this problem you will explore that criticism.

For simplicity, we will ignore the curvature of the earth, and just assume we are dealing with a set of points on a plane, each of which has a unique coordinate, and no three of which lie on a single straight line. Given such a set, and the thickness of your pencil, what is the largest number of points through which you can draw a single line?

输入格式

The first line of input consists of two integers and , where () is the number of points in the set and () is the thickness of the pencil. Then follow lines, each containing two integers and (), indicating the coordinates of a point in the set.

You may assume that the input is such that the answer would not change if the thickness was increased or decreased by , and that no three input points are collinear.

输出格式

Output the maximum number of points that lie on a single "line" of thickness .

样例

样例输入 1

4 2
0 0
2 4
4 9
3 1

样例输出 1

3

样例输入 2

3 1
0 10
2000 10
1000 12

样例输出 2

2