QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB Total points: 100 Difficulty: [show]

#1518. Tile

統計

题目描述

有一个 $n\times m$ 的网格,你希望用带编号的3-联通块(triomino,即俄罗斯方块中的那种联通块,3-长条形或L形)覆盖整个网格。这些3-联通块需要使用 $1$ 到 $nm/3$ 编号。另外,如果两个3-联通块 $X$、$Y$ 满足 $X$ 中存在任意一个格子处于 $Y$ 中某个格子的正左方或正上方,则必须有 $X$ 的编号小于 $Y$ 的编号。

你需要输出(带编号的)覆盖方案数,对 $10^9+7$ 取模。有多组数据。

输入格式

第一行正整数 $T$,表示数据组数。

接下来 $T$ 行每行两个正整数 $n,m$。

输出格式

$T$ 行一行一个答案。

样例数据

样例输入

3
1 2
3 4
9 10

样例输出

0
12
983018242

样例解释

对于样例中的第二组数据,所有方案如下图:

数据范围

对于所有数据,$T\le 10$,$n,m\le 10^4$。

Subtask 1(10pts):$n,m\le 4$。

Subtask 2(30pts):$n\le 4$,$m\le 100$。

Subtask 3(20pts):$n,m\le 100$。

Subtask 4(40pts):无特殊限制。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.