问题 A: Image Scaling

内存限制:256 MB 时间限制:1 S
题面:Markdown 评测方式:文本比较 上传者:
提交:56 通过:3

题目描述

You are given a $n\times m$ matrix consisting of $\tt{.}$ and $\tt{x}$. All $\tt{x}$s form a submatrix and you want to extract it and scale down as much as possible while keeping integer side length and unchanged aspect ratio. Output the final matrix. It's guaranteed that there's at least one $\tt{x}$ in the matrix.

输入格式

The first line contains two integers $n,m$. The following $n$ lines each contain a string of length $m$ consisting of $\tt{.}$ and $\tt{x}$.

输出格式

A matrix consisting of $\tt{x}$.

输入样例 复制

8 7
.......
..xxxx.
..xxxx.
..xxxx.
..xxxx.
..xxxx.
..xxxx.
.......

输出样例 复制

xx
xx
xx

数据范围与提示

$1\le n,m\le500$