Uva10572 Black and White

时间限制:1s    【提交】    空间限制:128MB

题目描述


输入格式

The first line in the input contains an integer T (less than 100), the number of cases to follow. Each case starts with two integers, M and N (2 ≤ M, N ≤ 8), the number of rows and columns respectively in the grid. The next M lines contains N characters each and describes the grid using the following characters:

# - a cell which is colored black
o - a cell which is colored white
. - a cell which color has not yet been assigned


输出格式

每组测试数据,输出一个数,表示方案总数


样例输入

1(1组输入)
2 3(m=2,n=3)
.o.
.#.

Hint
.表示未着色
#表示黑色
o表示白色
每组测试数据间用一个空行隔开



样例输出

9

提示


题目来源

没有写明来源