QOJ.ac

QOJ

Time Limit: 0.5 s Memory Limit: 256 MB Total points: 100

#11566. Gift for Anton

統計

Anton 想收到一张大小为 $n\times m$ 的矩形表格作为礼物,表格中填有数字 0、1、2、3 或 4。

如果满足以下条件,Anton 会很开心:每个 “0” 周围没有其他 “0”;每个 “1” 周围恰好有一个 “1”;每个 “2” 周围恰好有两个 “2”;每个 “3” 周围恰好有三个 “3”;每个 “4” 周围恰好有四个 “4”(也就是说,所有与 “4” 相邻的格子也都必须是 “4”)。

如果两个格子共享一条边,则认为它们是相邻的。

你需要设计一个表格作为礼物送给 Anton,使得他会感到开心。

下面是一个在 $n=4, m=6$ 时能让 Anton 开心的表格示例。

problem_11566_1.png

输入

一行包含两个整数 $n, m$ ($1 \leq n, m \leq 200$) --- 表格的尺寸。

可以证明,总是存在一种可行解。

输出

输出一个 $n$ 行 $m$ 列的表格 --- 作为送给 Anton 的礼物。

示例

输入

4 6

输出

1 1 2 2 2 1
0 2 2 0 2 1
1 2 0 2 2 0
1 2 2 2 1 1

评分

  1. ($10$ 分):$n = 1$;
  2. ($10$ 分):$n = 2$;
  3. ($10$ 分):$n = 3$;
  4. ($10$ 分):$n = m = 4$;
  5. ($10$ 分):$n = m = 30$;
  6. ($5$ 分):$n = 30, m = 31$;
  7. ($5$ 分):$n = 30, m = 32$;
  8. ($10$ 分):$n = m = 31$;
  9. ($5$ 分):$n = 31, m = 32$;
  10. ($10$ 分):$n = m = 32$;
  11. ($15$ 分):无额外限制。
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.