codeforces.com/contest/426/problem/D
const int MAXN = 110;int ipt[MAXN][MAXN];int main(){// freopen("in.txt", "r", stdin); int n, m, k; while (~RIII(n, m, k)) { REP(i, n) REP(j, m) RI(ipt[i][j]); if (n k) { int ans = INF; REP(i, n) { int tans = 0; REP(j, n) { int cnt = 0; if (i == j) continue; REP(k, m) { if (ipt[i][k] != ipt[j][k]) cnt++; } tans += min(cnt, m - cnt); } ans = min(ans, tans); } printf("%d\n", ans k) continue; int tans = 0; REP(j, n) { if (i == j) continue; int cnt = 0; for (int t = 0, l = 1; t <br> <br> <p></p>