#include <iostream>
#include <iomanip>
using namespace std;
int main () {
int const size = 9;
int A[100][100],n,a,j;
cout<<"Enter the length : ";
cin>>n;
for (int i=0; i<size; i++){
for (int k=0; k<n; k++){
A[i][k] = rand()%20;
}
cout<<endl;
}
for (int s=0; s<size; s++){
a = 0;
j = 0;
for (int m=0; m<n; m++){
cout<<setw(5)<<A[s][m];
a = a+ A[s][m];
j = a/(m+1);
}
cout<<setw(10)<<j<<endl;
}
cout<<endl<<endl;
return 0;
}