#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 10000000000000000 int main(){ int H,W,K; cin>>H>>W>>K; vector S(H); for(int i=0;i>S[i]; } int sum[26][H+1][W+1]; for(int i=0;i<26;i++){ for(int j=0;j1){ int cnt = 0; int mid = (ok1+ng1)/2; for(int k=0;k<26;k++){ int x = sum[k][i+mid][j+mid]+sum[k][i-1][j-1]-sum[k][i+mid][j-1]-sum[k][i-1][j+mid]; if(x>0)cnt++; } if(cnt>K)ok1=mid; else ng1=mid; } int ok2 = -1; int ng2 = min(H-i+1,W-j+1); while(ng2-ok2>1){ int cnt = 0; int mid = (ok2+ng2)/2; for(int k=0;k<26;k++){ int x = sum[k][i+mid][j+mid]+sum[k][i-1][j-1]-sum[k][i+mid][j-1]-sum[k][i-1][j+mid]; if(x>0)cnt++; } if(cnt