5391: Holding Two
内存限制:128 MB
时间限制:1.000 S
评测方式:文本比较
命题人:
提交:0
解决:0
题目描述
Given n,m , construct a matrix A of size n×m, whose entries are all either 0 or 1, and no three distinct entries Ai1,j1,Ai2,j2,Ai3,j3 satisfying that Ai1,j1=Ai2,j2=Ai3,j3。−1≤i1−i2=i2−i3≤1,−1≤j1−j2=j2−j3≤1。 If multiple solutions exist, print any one of them. If no solution, print "-1" in one line.
输入
Input only one line containing two integers n,m (1≤n,m≤1000)
输出
If solutions exist, print n lines each containing a 01-string of length m, denoting the matrix you construct. If no solution, print "-1" in one line.
样例输入 复制
3 3
样例输出 复制
110
001
100