#P12606. 碰碰车大战
碰碰车大战
Description
You are given integers , , and .
Your task is to construct tuples of size that satisfy the conditions below:
- is an integer in ;
- For any two tuples, after removing an element from the same position in both tuples, the resulting tuples (which have size ) are not equal. In other words, there still exists at least one position at which the remaining elements differ.
Formally, you need to satisfy:
- $\forall 1\le i\le k,1\le j\le m,x_{i,j}\in [1,n] \cap \mathbb{Z^+}$;
- $\forall 1\le i<j\le k,1\le p\le m,\exists 1\le l\le m,l\neq p,x_{i,l}\neq x_{j,l}$.
Input Format
The first line contains three integers , , and .
Output Format
Print lines. Each line should contain integers — the -th integer in the -th line represents .
3 3 3
1 2 1
2 1 2
3 3 3
Hint
This problem involves a large output size, so I/O optimization is recommended.
The problem uses subtask dependencies: failing a prerequisite subtask will result in a score of zero for any subtask.
It is guaranteed that for all testcases, $1\le n\le 10^9,2\le m\le 10^5,1\le k \le n^{m-1},k\times m\le 10^6$。
| # | Points | Depends On | |||
|---|---|---|---|---|---|
| - | |||||
| - | - | ||||
| - | |||||
京公网安备 11011102002149号