#P1330. Braille Recognition

Braille Recognition

Braille Recognition

题目描述

Given a piece of paper, you need to identify the Braille numbers (盲文数字) on it.

Braille is generally represented by a matrix of three rows and two columns of raised or unraised dots. We use * to represent a raised dot and .. to represent an unraised dot. Braille numbers typically come in two forms, one of which is as follows:

image.png

Here's the textual representation:

1 2 3 4 5 6 7 8 9 0
*.
..
*.
*.
.. **
**
.*
.. *.
.*
.. **
*.
.. **
**
.. *.
**
.. .*
*.
.. .*
**
..
The paper is given in a grid of N×MN×M cells. Please count the number of occurrences for each Braille number on the paper.

输入格式

The first line of input consists of two positive integers, NN and MM (1N,M100)(1≤N,M≤100).

The next NN lines each contain MM characters, which are either * or .., representing the symbols on the paper.

There may be cases where the numbers overlap, causing duplicated counting, as follows:

****
....
....

For such a case, you should count it as 33 occurrences for the number "33".

输出格式

Output in a single line containing 1010 numbers, representing the counts of Braille numbers 1,2,3,4,5,6,7,8,9,and 01, 2, 3, 4, 5, 6, 7, 8, 9, and \ 0 respectively. The numbers must be separated by 11 space, and there must be no extra space at the beginning or the end of the line.

样例 #1

样例输入 #1

7 10
..........
.*..**....
..........
..........
.***......
..*.......
..........

样例输出 #1

3 0 1 1 0 1 0 0 0 0