ソースコード
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
int H, W, N;
cin >> H >> W >> N;
vector<string> A(H);
for (int i = 0; i < H; i++) {
cin >> A[i];
}
vector<int> res(N + 1, 0);
vector<int> res2(N + 1, 0);
for (int i = 1; i <= N; i++) {
for (int x = 0; x < H; x++) {
int z = 0;
for (int y = 0; y < W; y++) {
if (A[x][y] == '.') {
z++;
if (z == i) {
res[i]++;
z = 0;
}
}
else {
z = 0;
}
}
}
}
for (int i = 1; i <= N; i++) {
for (int y = 0; y < W; y++) {
int z = 0;
for (int x = 0; x < H; x++) {
if (A[x][y] == '.') {
z++;
if (z == i) {
res2[i]++;
z = 0;
}
}
else {
z = 0;
}
}
}
}
for (int i = 1; i <= N; i++) {
cout << max(res[i], res2[i]) << endl;
}
}