Problems Description
<p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;"> with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats in remaining rows.</span> </p> <p class="MsoNormal" align="center" style="text-align:center;background:white;"> <br /> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">The event coordinator has a list of </span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;"> participants who should be picked up at the airport. When a participant</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;"> 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,</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;"> he will take the leftmost one.</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">In order to keep track of the people who are on the bus, the event coordinator needs a figure showing which</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;"> seats are going to be taken by </span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;"> participants. Your task is to draw the figure representing occupied seats.</span> </p>
Input格式
<p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">each line of input contains integer </span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;">, (0 ≤ </span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;"> ≤ 34), denoting the number of participants.</span> </p>
Output格式
<p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">Print the figure of a bus with </span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;"> passengers as described in sample tests. Character '#' denotes an empty seat,</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;"> while 'O' denotes a taken seat. 'D' is the bus driver and other characters in the output are for the purpose of</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;"> beautifying the figure. Strictly follow the sample test cases output format. Print exactly six lines. Do not output</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;"> extra space or other characters.</span> </p>
Sample
Sample Input 1
9
20
Sample Output 1
+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+
+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+
Submit Code
请先Login后Submit
🤖 AI 解题助手
OpenRouter
就绪