#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>

#define dim 2

int main(){

	pid_t m_pid;

  int matrice[dim][dim];
  int count = dim*dim+1;
  int res;
  int tmp;


  for(int i=0; i < dim; i++)
   {
      for(int j=0; j < dim; j++)
      {

        res=scanf("%d\n",&tmp);
        if(res=1){matrice[i][j]=tmp;}
      }
   }

  for (int i = 0; i < dim; i++) {
    for (int j = 0; j < dim; j++) {
      m_pid = fork();

      if (m_pid==0) {
        res=0;
        for (int k = 0; k < dim; k++) {
          res+=matrice[i][k]*matrice[k][j];
        }
        return res;
      }else{
        wait(&res);
        if (WIFEXITED(res)) {

            printf(" le resultat en %d,%d est : %d\n",i,j, WEXITSTATUS(res));

            }
      }
    }
  }

}
