#include using namespace std; typedef long long ll; int c[2001][2001][26]; signed main(){ ios::sync_with_stdio(false); // cin.tie(0); // cout << fixed << setprecision(20); int h,w,n; scanf("%d %d %d",&h,&w,&n); char s[h][w]; for(int i=0;i1){ mid=(up+low)/2; cnt = 0; for(int k=0;k<26;k++){ if(c[i][j][k] - c[i-mid][j][k] - c[i][j-mid][k] + c[i-mid][j-mid][k]>0) cnt++; } if(cnt<=n){ low=mid; } else{ up=mid; } } upper = low; low = -1, up = min(i,j)+1; while(up-low>1){ mid=(up+low)/2; cnt = 0; for(int k=0;k<26;k++){ if(c[i][j][k] - c[i-mid][j][k] - c[i][j-mid][k] + c[i-mid][j-mid][k]>0) cnt++; } if(cnt