QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 2048 MB Total points: 100

#10311. Urban Planning

الإحصائيات

你负责规划一座新城市!这座城市将由一个矩形网格表示,其中每个单元格要么是公园,要么是建筑区。

居民们自然希望在城市公园中散步。特别地,一个矩形漫步是指一个由网格单元格组成的矩形,其水平和垂直方向上至少各占 2 个单元格,且该矩形边界上的所有单元格均为公园。注意,矩形内部的单元格可以是任意的。

一个矩形漫步的示例(深色背景的单元格)。

你最喜欢的数字是 $k$。为了留下长久的印记,你希望设计这座城市,使其恰好拥有 $k$ 个矩形漫步。

输入格式

输入包含一个整数 $k$ ($0 \le k \le 4 \cdot 10^{12}$)。

输出格式

第一行输出两个整数 $h$ 和 $w$ ($1 \le h, w \le 2025$),表示网格的高度和宽度。

接下来的 $h$ 行,每行输出一个长度为 $w$ 的字符串,其中每个字符 '#' 表示公园,'.' 表示建筑区。

保证对于给定范围内的任何 $k$ 值,都存在一个高度和宽度在给定限制内的解。任何在给定限制内且恰好拥有 $k$ 个矩形漫步的城市设计方案均可被接受。

样例

输入 1

5

输出 1

3 4
####
#.##
####

说明

以下是五个可能的矩形漫步:

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.