QOJ.ac

QOJ

Límite de tiempo: 2.0 s Límite de memoria: 256 MB Puntuación total: 100

#12736. 黑与白

Estadísticas

评委们有一个伟大的艺术构想——用一大堆相同尺寸的黑白方块拼成一个矩形面板。该面板应恰好包含 $b$ 个由黑色方块组成的 4-连通区域,以及 $w$ 个由白色方块组成的 4-连通区域。

请记住,某种颜色的 4-连通区域是指该颜色面板方块的一个极大集合,满足: 该区域内的任意两个方块颜色相同; 对于该区域内的任意两个方块,都存在一条连接它们的方块序列,使得序列中任意两个相邻的方块都共用一条边。

除了这个艺术构想外,评委们已经开发了一个能生成面板设计的程序。但由于这是一个关于艺术的问题,任何新的解决方案对评委来说都极其重要。

输入格式

输入文件的唯一一行包含两个整数 $b$ 和 $w$ —— 分别表示黑色区域和白色区域的数量 ($1 \le b, w \le 1000$)。

输出格式

输出文件的第一行应包含面板的尺寸 $r$ 和 $c$ —— 分别表示行数和列数 ($1 \le r, c \le 100\,000$)。接下来应输出 $r$ 行,每行包含 $c$ 个字符。每个字符应为 ‘@’(代表黑色方块)或 ‘.’(代表白色方块)。面板中的方块总数不得超过 $100\,000$ 个。

样例

输入 1

2 3

输出 1

6 7
@@@@@@@
@.@@@@@
@@...@@
@@@@@@@
.......
@@@@@@@

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.