8985: link with Gomoku

内存限制:128 MB 时间限制:1 S
题面:传统 评测方式:Special Judge 上传者:
提交:8 通过:6

题目描述

“The more you win, the stronger your confidence becomes. The stronger your confidence, the more arrogant you become. The more arrogant you are, the easier it is to make mistakes. The more mistakes you make, the more you lose. So the more you win, the more you lose.”

link and Fall are playing Gomoku on a board with nnn rows and mmm columns, but neither of them wants to win (because the more they win, the more they lose). Therefore, they have decided to achieve a draw. Your task is to design a strategy for them to place their pieces on the board in such a way that the game ends in a draw.

If you have never played Gomoku before, here are the rules:

Black plays the first move (represented by `x'), and white plays the second move (represented by `o'). Each player takes turns placing their piece on an empty spot on the board. The game ends immediately if either player has five consecutive pieces in a row, column, or diagonal (both positive and negative). If the board is filled but neither player has five consecutive pieces, the game is a draw.

In this problem, the forbidden move rule is not used.

输入格式


The input contains multiple test cases.

The first line contains an integer T(1≤T≤103)T (1 \leq T \leq 10^3)T(1T103), representing the number of test cases.

For the following TTT lines, each containing two integers nnn and mmm (1≤n,m≤103)(1 \leq n, m \leq 10^3)(1n,m103), representing a test case.

It is guaranteed that ∑n×m≤106\sum n \times m \leq 10^6n×m106.

输出格式


For each test case, you need to output nnn lines, each containing mmm characters, representing the final state of the board. The jjj-th character of the iii-th line ci,jc_{i,j}ci,j represents the piece at row iii, column jjj of the board. If ci,jc_{i,j}ci,j is `x', it means the cell at row iii, column jjj contains a black piece. If ci,jc_{i,j}ci,j is `o', it means the cell at row iii, column jjj contains a white piece. If ci,jc_{i,j}ci,j is any other character, you will receive a `Wrong Answer' result.

If there is a line of five consecutive pieces on the board or the state you output cannot be the final state of a Gomoku game according to the aforementioned rules, you will receive a `Wrong Answer' result.

It can be shown that at least one solution exists. If there are multiple solutions, you can output any of them.

输入样例 复制

2
4 4
5 5

输出样例 复制

oooo
xxxx
oooo
xxxx
oooox
xxxxo
oooox
xxxxo
xoxox

分类标签