欢迎访问https://blog.youkuaiyun.com/lxt_Lucia~~
宇宙第一小仙女\(^o^)/~萌量爆表求带飞=≡Σ((( つ^o^)つ~ dalao们点个关注呗~
--------------------------------我只是一条可爱哒分界线-------------------------------
一、问题:
Description
Nastya came to her informatics lesson, and her teacher who is, by the way, a little bit famous here gave her the following task.
Two matrices A and B are given, each of them has size n×m. Nastya can perform the following operation to matrix A unlimited number of times:
- take any square square submatrix of A and transpose it (i.e. the element of the submatrix which was in the i-th row and j-th column of the submatrix will be in the j-th row and i-th column after transposing, and the transposed submatrix itself will keep its place in the matrix A).
Nastya's task is to check whether it is possible to transform the matrix A to the matr