2014
01-04

# Weak Number Recognition

Wiskey wants to develop an image retrieval system, but he can’t deal with the number recognition.

The number is neat which no any aliasing, no any redundant point, and made by ‘#’.
You can use the software “ASCII Art Studio”, the data come from there.

The font is Arial, and the font size between “五号” and “一号", the style is bold.
The data is weak, not all of the numbers which various sizes are need to be recognized.

First line will contain one integer mean how many cases will follow by.
In each case will contain two integers N, M mean the N*M matrix will follow. (10 <= N, M <= 26)

First line will contain one integer mean how many cases will follow by.
In each case will contain two integers N, M mean the N*M matrix will follow. (10 <= N, M <= 26)

2
10 7
###
#####
### ###
##   ##
##   ##
##   ##
##   ##
### ###
#####
###
14 9
#####
#######
###   ###
###   ###
###   ###
### ###
#####
#####
### ###
###   ###
###   ###
###   ###
#######
#####  

0
8