#2331. 3336. Uva10572 Black and White

3336. Uva10572 Black and White

#3336. Uva10572 Black and White

题目描述

![image](file://11(5).jpg)

输入格式

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  

数据范围与提示

![image](file://11(6).jpg)