302464: CF475A. Bayan Bus

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Bayan Bus

题意翻译

# 【题目大意】 有一辆公交车,上面有34个座位,除了最后一排有四个座位以外,前面每一排都有3个座位,由过道隔开。 每一个乘客上车后,都会选择**有空位的最后一排最左侧一个空位**入座,现在告诉你有k个人在车上(0 <= k <= 34),请你输出车的样子(见样例)。

题目描述

The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats in remaining rows. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF475A/8bce19353e5f54c2dfc8345d92904e1c0260a14e.png)The event coordinator has a list of $ k $ participants who should be picked up at the airport. When a participant gets on the bus, he will sit in the last row with an empty seat. If there is more than one empty seat in that row, he will take the leftmost one. In order to keep track of the people who are on the bus, the event coordinator needs a figure showing which seats are going to be taken by $ k $ participants. Your task is to draw the figure representing occupied seats.

输入输出格式

输入格式


The only line of input contains integer $ k $ , $ (0<=k<=34) $ , denoting the number of participants.

输出格式


The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats in remaining rows. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF475A/8bce19353e5f54c2dfc8345d92904e1c0260a14e.png)The event coordinator has a list of $ k $ participants who should be picked up at the airport. When a participant gets on the bus, he will sit in the last row with an empty seat. If there is more than one empty seat in that row, he will take the leftmost one. In order to keep track of the people who are on the bus, the event coordinator needs a figure showing which seats are going to be taken by $ k $ participants. Your task is to draw the figure representing occupied seats.

输入输出样例

输入样例 #1

9

输出样例 #1

+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

输入样例 #2

20

输出样例 #2

+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+

Input

题意翻译

# 【题目大意】 有一辆公交车,上面有34个座位,除了最后一排有四个座位以外,前面每一排都有3个座位,由过道隔开。 每一个乘客上车后,都会选择**有空位的最后一排最左侧一个空位**入座,现在告诉你有k个人在车上(0 <= k <= 34),请你输出车的样子(见样例)。

加入题单

上一题 下一题 算法标签: