当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7141:Ball

题目描述
Give a chessboard of $ M*M $ , with $ N$ point on it. You should calculate how many solutions there ar to select $ 3 $ points to make the median distance between the distance between the $ 3 $ points is a prime number?

the distance between $(x1,y1)$ and $(x2,y2)$ is $|x1-x2|+|y1-y2|$
输入解释
Each test contains multiple test cases. The first line contains the number of test cases $T$($1\le T \le 10$). Description of the test cases follows.

The first line of each test case contains two integers $N,M$

The next $N$ lines each line contains two integers $x_i,y_i$

It’s guaranteed there are no $i,j(i \neq j)$ satisfies both $x_i=x_j$ and $y_i=y_j$

$1\le N \le 2000,1\le M \le 10^5,1\le x_i,y_i\le M$
输出解释
For each test case, print one integer — the answer to the problem.
输入样例
2
3 3
1 1
2 2
3 3
3 3
1 1
2 1
3 2
输出样例
1
1

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7141

最后修改于 2022-09-15T06:16:59+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/10000MS(Java/Others) 524288/524288K(Java/Others)