{"problem":{"name":"Cross","description":{"content":"We have a grid with $H$ horizontal rows and $W$ vertical columns. We denote by $(i, j)$ the cell at the $i$\\-th row from the top and $j$\\-th column from the left of the grid.   Each cell in the grid h","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc300_c"},"statements":[{"statement_type":"Markdown","content":"We have a grid with $H$ horizontal rows and $W$ vertical columns. We denote by $(i, j)$ the cell at the $i$\\-th row from the top and $j$\\-th column from the left of the grid.  \nEach cell in the grid has a symbol `#` or `.` written on it. Let $C[i][j]$ be the character written on $(i, j)$. For integers $i$ and $j$ such that at least one of $1 \\leq i \\leq H$ and $1 \\leq j \\leq W$ is violated, we define $C[i][j]$ to be `.`.\n$(4n+1)$ squares, consisting of $(a, b)$ and $(a+d,b+d),(a+d,b-d),(a-d,b+d),(a-d,b-d)$ $(1 \\leq d \\leq n, 1 \\leq n)$, are said to be a **cross of size $n$ centered at $(a,b)$** if and only if all of the following conditions are satisfied:\n\n*   $C[a][b]$ is `#`.\n*   $C[a+d][b+d],C[a+d][b-d],C[a-d][b+d]$, and $C[a-d][b-d]$ are all `#`, for all integers $d$ such that $1 \\leq d \\leq n$,\n*   At least one of $C[a+n+1][b+n+1],C[a+n+1][b-n-1],C[a-n-1][b+n+1]$, and $C[a-n-1][b-n-1]$ is `.`.\n\nFor example, the grid in the following figure has a cross of size $1$ centered at $(2, 2)$ and another of size $2$ centered at $(3, 7)$.\n![image](https://img.atcoder.jp/ghi/abc300c_aa5161e20f55652dc61ad221348765bb002e4eed378c352bc0e44c7555148ebc.jpg)\nThe grid has some crosses. No `#` is written on the cells except for those comprising a cross.  \nAdditionally, no two squares that comprise two different crosses share a corner. The two grids in the following figure are the examples of grids where two squares that comprise different crosses share a corner; **such grids are not given as an input**. For example, the left grid is invalid because $(3, 3)$ and $(4, 4)$ share a corner.\n![image](https://img.atcoder.jp/ghi/abc300c2_796c45899f018c995738383146a76562824a9f6b7a3d931621da691d49d6f3cc.jpg)\nLet $N = \\min(H, W)$, and $S_n$ be the number of crosses of size $n$. Find $S_1, S_2, \\dots, S_N$.\n\n## Constraints\n\n*   $3 \\leq H, W \\leq 100$\n*   $C[i][j]$ is `#` or `.`.\n*   No two different squares that comprise two different crosses share a corner.\n*   $H$ and $W$ are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$H$ $W$\n$C[1][1]C[1][2]\\dots C[1][W]$\n$C[2][1]C[2][2]\\dots C[2][W]$\n$\\vdots$\n$C[H][1]C[H][2]\\dots C[H][W]$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc300_c","tags":[],"sample_group":[["5 9\n#.#.#...#\n.#...#.#.\n#.#...#..\n.....#.#.\n....#...#","1 1 0 0 0\n\nAs described in the Problem Statement, there are a cross of size $1$ centered at $(2, 2)$ and another of size $2$ centered at $(3, 7)$."],["3 3\n...\n...\n...","0 0 0\n\nThere may be no cross."],["3 16\n#.#.....#.#..#.#\n.#.......#....#.\n#.#.....#.#..#.#","3 0 0"],["15 20\n#.#..#.............#\n.#....#....#.#....#.\n#.#....#....#....#..\n........#..#.#..#...\n#.....#..#.....#....\n.#...#....#...#..#.#\n..#.#......#.#....#.\n...#........#....#.#\n..#.#......#.#......\n.#...#....#...#.....\n#.....#..#.....#....\n........#.......#...\n#.#....#....#.#..#..\n.#....#......#....#.\n#.#..#......#.#....#","5 0 1 0 0 0 1 0 0 0 0 0 0 0 0"]],"created_at":"2026-03-03 11:01:14"}}