QOJ.ac

QOJ

Límite de tiempo: 2.0 s Límite de memoria: 256 MB Puntuación total: 100 Hackeable ✓

#7200. 团

Estadísticas

平面上有 $n$ 个机器人,第 $i$ 个机器人位于点 $(x_i, y_i)$。编号为 $1$ 到 $a$ 的机器人被涂成红色,编号为 $a+1$ 到 $a+b$ 的机器人被涂成绿色,其余机器人被涂成蓝色。

每个机器人都要进行 $m$ 次移动。在一次移动中,位于 $(x, y)$ 的机器人可以移动到 $(x+1, y)$、$(x-1, y)$、$(x, y+1)$ 或 $(x, y-1)$。在 $m$ 次移动后,颜色相同的机器人必须位于同一位置,且颜色不同的机器人不能位于同一位置。

你需要求出有多少种不同的移动方式可以导致上述情况。如果最终位置不同,或者至少有一个机器人的移动路径不同,则认为两种移动方式不同。

输入格式

输入包含多个测试用例。对于每个测试用例:

第一行包含四个整数 $n, a, b$ 和 $m$ ($3 \le n \le 1000, 1 \le a, b < n, a+b < n, 1 \le m \le 1000$)。

接下来的 $n$ 行,每行包含两个整数 $x_i$ 和 $y_i$ ($|x_i|, |y_i| \le 1000$),表示第 $i$ 个机器人的位置。

所有测试用例中 $n$ 的总和不超过 $1000$。

输出格式

对于每个测试用例,输出移动方式的数量,结果对 $10^9 + 7$ 取模。

样例

样例输入 1

3 1 1 1
0 0
0 1
0 2

样例输出 1

60

样例输入 2

3 1 1 4
0 0
0 1
0 2

样例输出 2

15974400

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.