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

    ID: 10434 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 显示难度普及+/提高− 上传者: 标签>2021Special JudgeROIR(俄罗斯)

[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 1≤x1<x2≤n1\le x_1<x_2\le n and 1≤y1<y2≤m1\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 1∼c1\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, 2≤n,m≤102\le n,m\le 10 and 2≤c≤32\le c\le 3。

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

Translated by ChatGPT 5