1683: 上升点列
Description
在一个二维平面内,给定 个整数点 ,此外你还可以自由添加 个整数点。
你在自由添加 个点后,还需要从 个点中选出若干个整数点并组成一个序列,使得序列中任意相邻两点间的欧几里得距离恰好为 而且横坐标、纵坐标值均单调不减,即 或 。请给出满足条件的序列的最大长度。
Input
第一行两个正整数 分别表示给定的整点个数、可自由添加的整点个数。
接下来 行,第 行两个正整数 表示给定的第 个点的横纵坐标。
Output
Sample Input Copy
8 2
3 1
3 2
3 3
3 6
1 2
2 2
5 5
5 3
Sample Output Copy
8
HINT
【数据范围】
保证对于所有数据满足:1≤n≤500,0≤k≤100。对于所有给定的整点,其横纵坐标 1≤xi,yi≤10^9,且保证所有给定的点互不重合。对于自由添加的整点,其横纵坐标不受限制。
测试点编号 |
n≤ |
k≤ |
xi,yi≤ |
1∼2 |
1010 |
00 |
1010 |
3∼4 |
10 |
100 |
100 |
5∼7 |
500 |
0 |
100 |
8∼10 |
500 |
0 |
10^9 |
11∼15 |
500 |
100 |
100 |
16∼20 |
500 |
100 |
10^9 |