/* -*- coding: utf-8 -*- * * 3723.cc: No.3723 Climb or Detour - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 1000; /* typedef */ /* global variables */ char ss[MAX_N][MAX_N + 4]; /* subroutines */ /* main */ int main() { int n, k, sy, sx, ty, tx; scanf("%d%d%d%d%d%d", &n, &k, &sy, &sx, &ty, &tx); sy--, sx--, ty--, tx--; int d = abs(ty - sy) + abs(tx - sx); if (k < d || k > d * 2 || ((k - d) & 1)) { puts("-1"); return 0; } for (int i = 0; i < n; i++) fill(ss[i], ss[i] + n, '.'); int c = (k - d) / 2; for (int i = 1; i <= c; i++) { int dd = i * 2 - 1; for (int y = sy, x = sx + dd; x > sx; y--, x--) if (y >= 0 && y < n && x >= 0 && x < n) ss[y][x] = '#'; for (int y = sy - dd, x = sx; y < sy; y++, x--) if (y >= 0 && y < n && x >= 0 && x < n) ss[y][x] = '#'; for (int y = sy, x = sx - dd; x < sx; y++, x++) if (y >= 0 && y < n && x >= 0 && x < n) ss[y][x] = '#'; for (int y = sy + dd, x = sx; y > sy; y--, x++) if (y >= 0 && y < n && x >= 0 && x < n) ss[y][x] = '#'; } for (int i = 0; i < n; i++) puts(ss[i]); return 0; }