#T748. 同行列对角线的格
同行列对角线的格
Description
Input three natural numbers (, ), and output the positions of all grid cells in an chessboard (where rows and columns are numbered starting from 1) that are in the same row, same column, or same diagonal as the cell .
For example: , , represents the cell in the second row and third column of the chessboard.
When , , , the output is:
(2,1) (2,2) (2,3) (2,4) Positions of cells in the same row
(1,3) (2,3) (3,3) (4,3) Positions of cells in the same column
(1,2) (2,3) (3,4) Positions of cells on the top-left to bottom-right diagonal
(4,1) (3,2) (2,3) (1,4) Positions of cells on the bottom-left to top-right diagonal
Input Format
One line containing three natural numbers , , , separated by single spaces ().
Output Format
- First line: Output the positions of cells in the same row from left to right.
- Second line: Output the positions of cells in the same column from top to bottom.
- Third line: Output the positions of cells on the top-left to bottom-right diagonal.
- Fourth line: Output the positions of cells on the bottom-left to top-right diagonal.
Each cell position should be formatted as , where is the row number and is the column number, using English punctuation with no spaces in between. Separate adjacent cell positions with a single space.
4 2 3
(2,1) (2,2) (2,3) (2,4)
(1,3) (2,3) (3,3) (4,3)
(1,2) (2,3) (3,4)
(4,1) (3,2) (2,3) (1,4)
翻译结果
CodesOnline
(注:由于"CodesOnline"本身是一个专有名词或品牌名称,通常不需要翻译,直接保留原文即可。如果上下文中明确需要意译,可考虑译为"在线代码"或"代码在线",但此处建议保留原名称。)
翻译说明:
- 专有名词/品牌名采用不翻译原则
- 保持原始大写格式
- 未添加额外解释性文字(如需注释说明可用括号标注)
格式保留说明:
- 严格维持了二级标题的Markdown语法(##)
- 保持了原文的简洁呈现形式