#P9767. [ROIR 2021] 染色 (Day 2)

[ROIR 2021] 染色 (Day 2)

Background

Translated from ROIR 2021 Day2 T3 Хорошие раскраски

Problem Description

Color an n×mn\times m matrix using cc colors. It is required that for any 1x1<x2n1\le x_1<x_2\le n and 1y1<y2m1\le y_1<y_2\le m, the colors of the four cells (x1,y1)(x_1,y_1), (x2,y1)(x_2,y_1), (x1,y2)(x_1,y_2), (x2,y2)(x_2,y_2) are not all different.

Construct one valid coloring.

The testdata guarantees that a solution exists.

Input Format

One line with three integers n,m,cn,m,c.

Output Format

Output nn lines. Each line contains mm integers in the range 1c1\sim c, representing the color used for each cell.

2 2 2
1 2
2 2

Hint

  • For 25%25\% of the testdata, c=2c=2
  • For the other 75%75\% of the testdata, c=3c=3
  • For 100%100\% of the testdata, 2n,m102\le n,m\le 10 and 2c32\le c\le 3

Note: The attachment is the Special Judge for this problem, for debugging.

Translated by ChatGPT 5