CF1530B Putting Plates
题目描述
有一张桌子,分为 $h$ 行 $w$ 列。
桌子**边缘**上的某一行某一列可以放一个盘子(也可以不放)。但是,一个盘子的上面、下面、左面、右面、左上、右上、左下、右下都不能有盘子。
问题来了:这个桌子,放盘子最多的方案是什么?请输出这个方案。当然,答案不止一种,你也不用全部输出,输出任意一个,即可。
输入格式
第一行一个数 $t$($1\le t\le100$),表示测试数据组数。
接下来 $t$ 行,每行两个数,分别代表 $h$ 和 $w$($3\le h,w\le20$)。
输出格式
输出这个桌子放盘子最多的方案。盘子用 `1` 表示,空位用 `0` 表示。
每个测试数据之间都要打印一个空行。
Translated by [dengzijun](https://www.luogu.com.cn/user/387836)
说明/提示
For the first test case, example output contains the only way to put $ 6 $ plates on the table.
For the second test case, there are many ways to put $ 4 $ plates on the table, example output contains one of them.
Putting more than $ 6 $ plates in the first test case or more than $ 4 $ plates in the second test case is impossible.