AtCoder Beginner Contest 173
C
H and V
AtCoder
⌀ 653
原题
← BD →
翻译中…

Problem Statement

翻译中…

We have a grid of $H$ rows and $W$ columns of squares. The color of the square at the $i$-th row from the top and the $j$-th column from the left $(1 \leq i \leq H, 1 \leq j \leq W)$ is given to you as a character $c_{i,j}$: the square is white if $c_{i,j}$ is ., and black if $c_{i,j}$ is #.

翻译中…

Consider doing the following operation:

翻译中…
  • Choose some number of rows (possibly zero), and some number of columns (possibly zero). Then, paint red all squares in the chosen rows and all squares in the chosen columns.
翻译中…

You are given a positive integer $K$. How many choices of rows and columns result in exactly $K$ black squares remaining after the operation? Here, we consider two choices different when there is a row or column chosen in only one of those choices.

翻译中…

Constraints

翻译中…
  • $1 \leq H, W \leq 6$
  • $1 \leq K \leq HW$
  • $c_{i,j}$ is . or #.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

H W K
c_{1,1}c_{1,2}...c_{1,W}
c_{2,1}c_{2,2}...c_{2,W}
:
c_{H,1}c_{H,2}...c_{H,W}

翻译中…

Output

翻译中…

Print an integer representing the number of choices of rows and columns satisfying the condition.

翻译中…

样例

Input #1
2 3 2
..#
###
Output #1
5
Five choices below satisfy the condition. - The $1$-st row and $1$-st column - The $1$-st row and $2$-nd column - The $1$-st row and $3$-rd column - The $1$-st and $2$-nd column - The $3$-rd column
Input #2
2 3 4
..#
###
Output #2
1
One choice, which is choosing nothing, satisfies the condition.
Input #3
2 2 3
##
##
Output #3
0
Input #4
6 6 8
..##..
.#..#.
#....#
######
#....#
#....#
Output #4
208
题目信息
题号
abc173_c
时间限制
1 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。