logo AlgoBeat OnlineJudge
登录 注册

#206187. [NWRRC 2017] Kotlin Island

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

There is an urban myth that Peter the Great wanted to make a rectangular channel-grid engineering masterpiece not only from Vasilyevskiy island, but also from Kotlin island (where the town of Kronstadt is located nowadays).

The following mathematical model was (allegedly) presented to the tsar. The island is considered a rectangular grid cells high and cells wide. Each cell is dry land initially but can become water.

Technologies of those days allowed engineers to dig a channel across the entire island. In that case an entire row or an entire column of cells became water. If some of these cells already were water, their status did not change.

Your task is to propose a plan of the island which has exactly connected components of dry land cells.

输入格式

The only line of the input contains three integers , and -- grid's height, width and the desired number of connected components ;

输出格式

If there is no valid plan containing connected components, output a single word Impossible.

Otherwise output lines of length depicting the plan. Dot represents a dry land cell, hash You can't use 'macro parameter character #' in math mode(‘#') represents a water cell.

样例

样例输入 1

3 5 4

样例输出 1

..#..
#####
..#..

样例输入 2

2 1 1

样例输出 2

#
.

样例输入 3

5 3 10

样例输出 3

Impossible

数据范围与提示

Time limit: 3 s, Memory limit: 512 MB.