logo AlgoBeat OnlineJudge
登录 注册

#212607. [UOI 2025] Gift for Anton

内存限制:256 MiB 时间限制:500 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Anton wants to receive as a gift a rectangular table of size filled with the numbers 0, 1, 2, 3, or 4.

Anton will be happy if there is no other "0" next to each "0", exactly one other "1" next to each "1", exactly two other "2"s next to each "2", exactly three other "3"s next to each "3", and exactly four other "4"s next to each "4" (i.e., all neighbors of "4" must also be "4").

One cell is considered to be next to another if they share a side.

You need to come up with a table that can be gifted to Anton so that he will be happy.

Below is an example of a table that will make Anton happy with .

输入格式

A single line contains two numbers () --- the dimensions of the table.

It can be shown that a solution always exists.

输出格式

Output a table with rows and columns --- a gift for Anton.

样例

样例输入 1

4 6

样例输出 1

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

数据范围与提示

  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): no additional restrictions.