#include "iostream"
#include "time.h"
using namespace std;
const int N=512;
const int M=512;
const int NN=512;
const int MM=512;
void main(){
int a[N][M];
int b[NN][MM];
int c[N][MM];
clock_t start,finish;
start=clock();
for(int i=0;i<N;i++)
for(int j=0;j<M;j++)
{a[i][j]=1;
b[i][j]=1;
}
int i=0,j=0,x=0,k=0;
/*for(int i=0;i<N;i++)
{for(int j=0;j<M;j++)
cout<<a[i][j]<<" ";
cout<<endl;
}
*/
/*for(int i=0;i<NN;i++)
{for(int j=0;j<MM;j++)
b[i][j]=1;
}*/
/*for(int i=0;i<NN;i++)
{for(int j=0;j<MM;j++)
cout<<a[i][j]<<" ";
cout<<endl;
}*/
int sum;
for(int i=0;i<N;i++)
{
for(x=0;x<MM;x++)
{ sum=0;
for( j=0;j<M;j++)
sum+=a[i][j]*b[j][x];
c[i][x]=sum;
}
}
for( i=0;i<N;i++)
{ for(j=0;j<MM;j++)
cout<<c[i][j]<<" ";
cout<<endl;
}
finish=clock();
cout<<(finish-start)/1000.0<<"seconds"<<endl;
//getchar();
system("pause");
}