영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)
시간 제한 1초 · 메모리 제한 512 MB
Problem
Your task is to fill an n × m grid using L-trominos (three squares that have an L-shape). For example, here is one way to fill a 4 × 6 grid:
(그림은 원문 페이지에서 볼 수 있습니다)
Input
The first input line has an integer t: the number of tests.
After that, there are t lines that describe the tests. Each line has two integers n and m.
Output
For each test, print YES if there is a solution, and NO otherwise.
If there is a solution, also print n lines that each contain m letters between A–Z. Adjacent squares must have the same letter exactly when they belong to the same tromino. You can print any valid solution.
Constraints
- 1 ≤ t ≤ 100
- 1 ≤ n,m ≤ 100
예제
예제 1
2 4 6 4 7
YES AADDBB ACCDEB BCAEEC BBAACC NO