#include<stdio.h> int main() { int i,q,j,n,m; while (~scanf("%d%d", &n, &m)) { float a[100][100]; float xs[100], kc[100]; float sum = 0; int nb = 0, nnb = 0; for (i = 0; i < n; i++) for (j = 0; j < m; j++) { scanf("%f", &a[i][j]); } for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { sum = sum + a[i][j]; } xs[j]= sum / m; printf("%.2f ", xs[j]); sum = 0; } printf("\n"); for (q=0,j = 0; j < n; j++,q++) { for (i = 0; i < m; i++) { sum = sum + a[i][j]; } kc[q] = sum / n; printf("%.2f ", kc[q]); sum = 0; } printf("\n"); for (i = 0; i < n; i++) { for (q=0,j = 0; j < m; j++,q++) { if (a[i][j] > kc[q]) nb++; } if (nb == m) nnb++; } printf("%d\n", nnb); } return 0; }