AT_scpc2026_div1_c SCSC Magical Garden

Description

#### 表示言語 / / Haru\_101 prepared an $ N \times N $ grid-shaped garden for SCSC. Every spring, SCSC members have a beautiful tradition of planting one flower in each cell. This year, they decided to plant sunflowers and clovers. After all flowers were planted, Terra and Lulu looked around the garden and gave different impressions. Terra looked down at the whole garden from a high place and said: "Looking at the whole garden, there are more cells planted with blue clovers than yellow sunflowers!" Lulu likes taking photos, so Lulu walked around the garden and took photos of size $ 3 \times 3 $ . After taking photos of every $ 3 \times 3 $ area in the garden without omission, Lulu looked at the photos and said: "Huh? In every photo I took, there are more sunflowers than clovers!" Can you make a magical garden where, as Terra said, the whole garden has more clovers, but every photo Lulu took has more sunflowers?

Input Format

The input is given from Standard Input in the following format: > $ T $ $ \mathrm{case}_1 $ $ \mathrm{case}_2 $ $ \vdots $ $ \mathrm{case}_T $ Each test case is given in the following format: > $ N $

Output Format

For each test case, output the answer in the following format. If it is possible to make a magical garden, output `YES` on the first line. Then output $ N $ lines, each containing a string of length $ N $ representing the state of the garden. Each string must consist only of `S` and `C`. The $ j $ -th character of the $ i $ -th string must be `S` if the flower planted in cell $ (i,j) $ of the garden is a sunflower, and `C` if it is a clover. In every $ 3 \times 3 $ subgrid of the grid, **the number of `S` must be greater than the number of `C`**, and in the whole grid, **the number of `C` must be greater than the number of `S`**. If there are multiple magical gardens, output any one of them. If it is impossible to make a magical garden, output `NO` on a single line instead.

Explanation/Hint

### Constraints - $ 1 \leq T \leq 1\,000 $ - For each test case, $ 3 \leq N \leq 1\,000 $ . - All given numbers are integers. - Only cases where the output does not exceed $ 2 $ MiB are given.