git reimport

This commit is contained in:
2019-03-15 13:47:54 +04:00
commit 3b461f73de
489 changed files with 1631603 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
package chelper;
import io.InputReader;
import io.OutputWriter;
import misc.SimpleSavingChelperSolution;
public class TaskA extends SimpleSavingChelperSolution {
public void solve(int testNumber, InputReader in, OutputWriter out) {
wrapSolve(testNumber, in, out);
}
@Override
public void solve(int testNumber) {
int n = in.nextInt();
int m = in.nextInt();
int[][] a = new int[n][m];
int c = 1;
for (int i = 0; i < 100; i++) {
for (int j = 0; j < 100; j++) {
int x = i - j;
int y = j;
if (x < 0 || y < 0 || x >= n || y >= m) {
continue;
}
a[x][y] = c;
c++;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
out.print(a[n - 1 - i][m - 1 - j] + " ");
}
out.println();
}
}
}