QOJ.ac

QOJ

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

#11566. Gift for Anton

Statistics

Anton wants to receive as a gift a rectangular table of size $n\times m$ 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 $n=4, m=6$.

problem_11566_1.png

Input

A single line contains two numbers $n, m$ ($1 \leq n, m \leq 200$) --- the dimensions of the table.

It can be shown that a solution always exists.

Output

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

Example

Input

4 6

Output

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

Scoring

  1. ($10$ points): $n = 1$;
  2. ($10$ points): $n = 2$;
  3. ($10$ points): $n = 3$;
  4. ($10$ points): $n = m = 4$;
  5. ($10$ points): $n = m = 30$;
  6. ($5$ points): $n = 30, m = 31$;
  7. ($5$ points): $n = 30, m = 32$;
  8. ($10$ points): $n = m = 31$;
  9. ($5$ points): $n = 31, m = 32$;
  10. ($10$ points): $n = m = 32$;
  11. ($15$ points): no additional restrictions.
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.