矩阵

Tag:

Background

Because Euler is devoted to the study of maps, he invented a matrix in his spare time. This matrix, where, before me, are the ages that have gone? and and where, behind me, are the coming generations?, is extremely dirty!

由于欧拉致力于图的研究,因此他在闲暇(\(gǎo jī\))时间发明了一个矩阵,此矩阵前不见古人,后不见来者,可谓是 龌龊至极啊!

Description

Some letters can be used to form some beautiful matrices. ~
The following is the matrix Euler drew recently: This is a matrix with 5 rows and 7 columns, please find out the rules of this matrix and output a matrix with n rows and m columns.

利用一些字母可以组成一些美丽的矩阵,下面是欧拉最近画的矩阵:

ABCDEFG
BABCDEF
CBABCDE
DCBABCD
EDCBABC

这是一个5行7列的矩阵,请找出这个矩阵的规律,并输出一个n行m列的矩阵。

Input

Enter a row containing two integers n,m, which represent the number of rows and columns of the matrix you want to output.

输入一行,包含两个整数\(n,m\),分别表示你要输出的矩阵的行数和列数。

Output

Output a matrix with n rows and m characters per row.

输出一个矩阵,有\(n\)行,每行\(m\)个字符

Input

5 7

Output

ABCDEFG
BABCDEF
CBABCDE
DCBABCD
EDCBABC

Limitation

\(1<=n<26,m<=26.\)

Source

Amorphophallus Orz Group

信息

ID
1003
难度
3
分类
矩阵乘法 点击显示
标签
递交数
4
已通过
2
通过率
50%
上传者

相关

在下列训练计划中:

AOG题库训练计划