PivotOJ

KIT Finding

시간 제한: 2000ms메모리 제한: 2048MB출처: NWERC 2025BOJ 35082

문제

"Find the Fox" is a recent book that contains 200200 pages of word search puzzles comprising only the letters 'F', 'O' and 'X'. The special feature of the book is that there is only a single occurrence of the word "FOX" throughout all of its pages.

Recall that in a word search the goal is to find hidden words (only one hidden word in this case) in a grid of letters. The words can occur horizontally or vertically or diagonally, as well as forwards or backwards, allowing for a total of 88 different reading directions.

For this year's NWERC, we want to create a baby version of "Find the Fox". Your goal in this problem, therefore, is to create a word search grid with given dimensions and containing each of the letters 'K', 'I' and 'T' a given number of times. Similar to the original book, this grid should contain exactly one occurrence of the word "KIT".

Figure K.1: Illustration of Sample Output 1. Flip page for the solution.

입력

The input consists of:

  • One line with five integers hh, ww, kk, ii, and tt (3h,w1003 \le h,w \le 100, k,i,t1k,i,t \ge 1, k+i+t=hwk+i+t = h\cdot w), where hh and ww are the height and width the word search grid should have, and kk, ii, and tt specify the required number of occurrences of 'K', 'I' and 'T', respectively.

출력

Output a word search grid according to the given rules. It can be shown that such a word search grid always exists.

If there are multiple valid solutions, you may output any one of them.

힌트

예제

예제 1

입력
4 5 6 7 7
출력
IKIIT
KKTKT
ITITI
KTTKI

예제 2

입력
3 3 1 7 1
출력
III
KIT
III
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.