305145: CF980B. Marlin
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Marlin
题意翻译
## 题目描述 鱼托邦市可以想象成一个4行且每行包含n个奇数的网格。 它有两个主要的村庄:第一个位于左上方的方格(1,1),住在那里的人喜欢在右下方的方格(4,n)的金枪鱼池塘钓鱼。第二个村庄位于(4,1),人们喜欢(1,n)的鲑鱼池塘。 鱼托邦市市市长想在该市设立k家酒店,每家都占据一个方格。为了让人们可以从任何地方进入城市,酒店不应设在边缘。 如果两个方格均没有被旅馆占据并共用一条边,一个人可以从一个方格移动到另一个方格。 你能帮助市长把旅馆安置在一个地方,使得每个村子的人都有相同数量的最短路径到他们的首选池塘吗? ## 输入格式 输入的第一行包含两个整数,n和k(3≤n≤99,0≤k≤2×(n−2),n为奇数)、城市宽度和要入住的酒店数量。 ## 输出格式 如果可以以满足要求的方式放置所有酒店,输出“YES”,否则输出“NO”。 如果可以的话,再输出4行来描述这个城市,每行n个字符。如果这个单元格有酒店的话,输出“#”,如果没有,则输出“.”。题目描述
The city of Fishtopia can be imagined as a grid of $ 4 $ rows and an odd number of columns. It has two main villages; the first is located at the top-left cell $ (1,1) $ , people who stay there love fishing at the Tuna pond at the bottom-right cell $ (4, n) $ . The second village is located at $ (4, 1) $ and its people love the Salmon pond at $ (1, n) $ . The mayor of Fishtopia wants to place $ k $ hotels in the city, each one occupying one cell. To allow people to enter the city from anywhere, hotels should not be placed on the border cells. A person can move from one cell to another if those cells are not occupied by hotels and share a side. Can you help the mayor place the hotels in a way such that there are equal number of shortest paths from each village to its preferred pond?输入输出格式
输入格式
The first line of input contain two integers, $ n $ and $ k $ ( $ 3 \leq n \leq 99 $ , $ 0 \leq k \leq 2\times(n-2) $ ), $ n $ is odd, the width of the city, and the number of hotels to be placed, respectively.
输出格式
Print "YES", if it is possible to place all the hotels in a way that satisfies the problem statement, otherwise print "NO". If it is possible, print an extra $ 4 $ lines that describe the city, each line should have $ n $ characters, each of which is "\#" if that cell has a hotel on it, or "." if not.
输入输出样例
输入样例 #1
7 2
输出样例 #1
YES
.......
.#.....
.#.....
.......
输入样例 #2
5 3
输出样例 #2
YES
.....
.###.
.....
.....