function [] = prog1main()
n=4;

for i= 1:n
  a=0;
   for j = 1:n 
       x=1/(i+j-1);
       y=str2num(sprintf('%.12f\n',x));
       A(i,j) =y;
      a=a+x;
      B(i,i)=1;
   
   end 
    
end
disp(B)
C=A^(-1);
D=A;
disp(C)

for s=1:n
    A=D;
for j=1:n
    g=abs(A(j,j));
     for i=j:n
         if abs(A(i,j))>g
             g=abs(A(i,j));
             x=i;
         end
     end
     if abs(A(j,j))==g
     else    
        t=A(j,j:n);
        A(j,j:n)=A(x,j:n);
        A(x,j:n)=t;
        t=B(j,s);
        B(j,s)=B(x,s);
        B(x,s)=t;
     end
    
     for i=j+1:n
      L=A(i,j)/A(j,j);
      A(i,j:n)=A(i,j:n)-A(j,j:n)*L;
      B(i,s)=B(i,s)-B(j,s)*L;
     end  
 end 
 X(1:n,s)=0;
  for i=1:n
      BB=A(n+1-i,1:n)*X(1:n,s);
      X(n+1-i,s)=(B(n+1-i,s)-BB)/A(n+1-i,n+1-i);
  end 
end 
  disp(X)
  g1=0;
  g2=0;
 for i=1:n 
  p=0;
  q=0;
  
  for j=1:n
    p=D(i,j)+p;
    q=X(i,j);
  end
  if p>g1
     g1=p;
  end
  if q>g2
     g2=q;
  end
end
  k=g1*g2
return