海与岛

TimeLimit:1000MS  MemoryLimit:256MB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description

图片.png

Input

The single line contains two positive integers n, k (1 ≤ n ≤ 100, 0 ≤ k ≤ n2) — the size of the map and the number of islands you should form.

Output

If the answer doesn't exist, print "NO" (without the quotes) in a single line.

Otherwise, print "YES" in the first line. In the next n lines print the description of the map. Each of the lines of the description must consist only of characters 'S' and 'L', where 'S' is a cell that is occupied by the sea and 'L' is the cell covered with sand. The length of each line of the description must equal n.

If there are multiple answers, you may print any of them.

You should not maximize the sizes of islands.

SampleInput 1
5 2
SampleOutput 1
YES
SSSSS
LLLLL
SSSSS
LLLLL
SSSSS
SampleInput 2
5 25
SampleOutput 2
NO
Submit
题目统计信息详细
总AC数30
通过人数8
尝试人数9
总提交量37
AC率21.62%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: