| TheForces Round #44 (DIV3.5-Forces) |
|---|
| Finished |
There's a $$$1 \times n$$$ grid. For a string $$$y$$$ of length $$$l$$$, a robot moves according to the following pattern.
You are given a possibly incomplete string $$$x$$$ of length $$$m$$$. Your task is to complete the string $$$x$$$ such that, regardless of which cell the robot selects as the starting point, it will always explode. If there's no such string, output "NO" instead.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n,m \le 50$$$).
The second line of each test case contains a string $$$x_1x_2 \ldots x_{m}$$$ of length $$$m$$$ consisting of characters 'L', 'R' and '?'. If $$$x_i=\mathtt{?}$$$ ($$$1 \le i \le m$$$), it means you need to choose 'L' or 'R' as the value of $$$x_i$$$.
For each test case, if there's no such string, output "NO" in a new line. Otherwise, output "YES" in a new line, then output the complete string $$$x$$$ in the next line.
41 1L2 1?3 5LR?R?50 5?????
YES L NO YES LRRRL NO
In the first test case, the robot can only choose the first cell as the start point. Then, in the first move, the robot moves one cell to the left, which is out of bounds. After the first move, the robot will explode, so the answer is "YES".
In the second test case, if $$$x=\mathtt{L}$$$, the robot can choose the second cell as the start point. If $$$x=\mathtt{R}$$$, the robot can choose the first cell as the start point. In both cases, the robot will not explode. Thus, the answer is "NO".
| Name |
|---|


