#970
Unrated
CUDOVISTE
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Mirko got his drivers license! To celebrate that joyous occasion, his parents bought him his first car: a monster truck! Mirko found out that even though having a car that can squash all other cars is nice in traffic jams, parking a car that is the size of 4 normal cars can be a bit tricky. His friend, Slavko, works part time in the city parking company. He periodically sends Mirko a map of the city with occupied parking spaces marked. The map can be represented as a table with R rows, C columns each. Each cell can contain a building (symbol '#'), a parked car (symbol 'X') or a free parking space (symbol '.'). A monster truck is quite huge, 2 by 2 cells to be exact. Help Mirko calculate the number of possible parking space grouped by the number of cars he needs to squash to park in them. We are only interested in the number of cars Mirko will squash on the parking space, not the number of cars he will squash on the way over. However, Mirko can't park on a building. Not even a monster truck is large enough to squash buildings!

입력

The first line of input contains two integers, R and C (2 ≤R, C ≤50), the number of rows and columns of the map. The second R lines contain C characters each. Only characters '#', 'X' and '.' appear in the input. Note that 'X' will always be capital.

출력

The output consists of five lines, the total number of parking spaces Mirko can park on if he squashes 0 cars (first line), 1 car (second line), 2 cars (third line), 3 cars (fourth line), 4 cars (fifth line).

예제 입력 1

4 4
#..#
..X.
..X.
#XX#

예제 출력 1

1
1
2
1
0

예제 입력 2

4 4
....
....
....
....

예제 출력 2

9
0
0
0
0

예제 입력 3

4 5
..XX.
.#XX.
..#..
.....

예제 출력 3

2
1
1
0
1
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.