#include<iostream>
#include <iomanip>
#include<conio.h>
using namespace std;
int main()
{
	double Matrix1[10][10];
	double Matrix2[10][10];
	double Matrix3[10][10] = {0};
	int i, j, k, m, n, p;
	cout << "m = ";
	cin >> m;
	cout << "n = ";
	cin >> n;
	cout << "p = ";
	cin >> p;
	cout << "aedad matrix " << m << " * " << n << " : " << endl;
	//nested loop avval
	//por kardane matrise avval
	for(i = 0; i < m; i++)
		for(j = 0; j < n; j++)
			cin >> Matrix1[i][j];
			
	cout << "aedad matrix " << n << " * " << p << " : " << endl;
	//nested loop dovvom
	//por kardane matrise dovvom	
	for(i=0; i < n; i++)
		for(j=0; j < p; j++)
			cin >> Matrix2[i][j];
	//nested loop sevvom
	//amale zarbe matrise avval va dovvom va zakhire dar matrise sevvom
	for(i=0; i < m; i++)
		for(j=0; j < p; j++)
			for(k=0; k < n; k++)
				Matrix3[i][j] += Matrix1[i][k] * Matrix2[k][j];
	//loop chaharom
	for(i=0; i < m; i++)
	{
		for(j=0; j < p; j++)
			cout << fixed << setprecision(2) << setw(7) << setfill(' ') << Matrix3[j][i];
		cout << endl;
	}
	getch();
}

