Painting Grid
시간 제한1초메모리 제한1024 MB
n×m 격자마다 검은 칸이 정확히 절반이고 모든 행과 열이 서로 다른 흑백 배색이 존재하는지 판정하고, 존재하면 하나를 출력한다.
문제
Grammy has an wall covered by squares. Each small square on the wall is of unit size and should be painted into one color completely. She wants to color the wall into black and white. Grammy likes the concept of diversity, so she decided to make each row look different from all previous rows and also make each column look different from all previous columns. As she was about to paint, she found her paint was just enough: half of white paint and half of black paint, both with an amount to paint exactly unit area. Please help Grammy to satisfy her diversity condition using limited paint.
입력
The input contains multiple test cases.
The first line contains a single integer (), denoting the number of test cases.
For each test case:
The only line contains two integers and (). It is guaranteed that the sum of does not exceed .
출력
For each test case, if no solution exists, output "NO". Otherwise, output "YES" followed by lines. Each line should contain characters. denotes a white square and denotes a black square in the solution.