7336: BZOJ3336:Uva10572 Black and White

Memory Limit:128 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description


输入格式

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

提示


题目来源

没有写明来源

加入题单

上一题 下一题 算法标签: