#include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n,m,q; cin>>n>>m>>q; vector>a(n,vector(m,0)); int * piles = new int[m]; for(int i=0;i>x; if(x == '*') a[i][j] = 1; } } int t,cnt=0,st_time=1; for(int i = 0;i>t; for(int k=st_time;k<=t;k++) { if(k > n) break; for(int col=0;col=0;row--) { if(a[row][col] == 1 && a[row+1][col]!=1) { a[row+1][col]=1; a[row][col]=0; } } } for(int col=0;col=0;row--) { if(a[row][col] == 1) { cnt++; piles[col]--; } else break; } } } st_time = t+1; cout<