题解:CF1996B Scale
这道题是一道简单题。
我们可以发现,把图像缩小
#include <iostream>
using namespace std;
int n, m;
char ch[1005][1004];
int main() {
int t;
cin >> t;
while (t--) {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
cin >> ch[i][j];
}
}
for (int i = 1; i <= n; i += m) {
for (int j = 1; j <= n; j += m) {
cout << ch[i][j];
}
cout << '\n';
}
}
}