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

建议使用的浏览器:

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

5998:jvjhfhg loves Magic Tower

题目描述
Jvjhfhg is a pupil who loves a flash game called "Magic Tower". He always searches for various "Magic Towers".

Jvjhfhg finds a game called "Magic Tower - Step the Lamps".

In an $n \times m$ map($m$ is an odd number) where the first coordinate on the first line is $(1, 1)$ and the last coordinate on the last line is $(n, m)$, there's a "lamp" on every checker, which has two mode: on and off. At first, all "lamps" are switched OFF. Jvjhfhg sets off from a special checker $(0, \frac{(m + 1)}{2})$ which as well as $(n + 1, \frac{(m + 1)}{2})$ has no "lamp". Of course stepping on these two checkers is available. When Jvjhfhg goes onto a has-lamp checker whose coordinate is $(x, y)$, the mode of the light of the checker, as well as those of the lights of $k + 1$ checker, namely $(x + x_1, y + y_1),(x + x_2, y + y_2),\cdots ,(x + x_k, y + y_k)$, will alter. When all the "lamps" are on, the game ends. The author found that the game is so effortless when many checkers can only alter its own if the sum of ${x}_{i}$ and ${y}_{i}$ is too large or the map is too small, so he sets: $|xi| + |yi| \leq 5$ and $n,m \geq 5$.

Jvjhfhg completes the game soonly, but he's still wondering how many paths can end the game. He finds that there could be infinite possibilities, so he decides that if all with-lamp checkers are passed for the number of times of same parities in two paths, these two paths are counted as one.

**Print the answer modulo ${10}^{9}+7$.**
输入解释
The first line contains an integer $T$ denoting the number of cases.

For each case, the first line contains three integers $n,m,k$,while $m$ is odd.

The next $k$ lines each contains two integers $x_i,y_i$. Data ensures that $|xi| + |yi| \leq 5$.

$1 \leq T \leq 5$, $5 \leq n, m \leq 100$, $1 \leq k \leq 10$
输出解释
For each case, print a single line with an integer denoting the answer.
输入样例
1
5 5 4
-1 0
1 0
0 1
0 -1
输出样例
4
来自杭电HDUOJ的附加信息
Recommend wange2014

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

题目来源 BestCoder Round #90

源链接: HDU-5998

最后修改于 2020-10-25T23:27:24+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000/2500MS(Java/Others) 131072/131072K(Java/Others)