program tp_1;
        const
             n=2;
             m=5;
var
   A: array[1..n,1..m] of real;
   detA: real;
   i,j: integer;
   x,y,xi,yi,x2i,x3i,x4i,xiyi,x2iyi,det,det1,det2,det3,ao,bo,co: real;
begin
     For i:=1 to 2 do
     For j:=1 to 5 do
     begin
     Write ('A[',j,',',i,'] = ');
     Readln(A[i,j]);
     end;
     For j:=1 to 5 do
     xi:=xi+A[1,j];
     Writeln('Сумма Xi = ',xi);
     For j:=1 to 5 do
     yi:=yi+A[2,j];
     Writeln('Сумма Yi = ',yi);
     For j:=1 to 5 do
     x2i:=x2i+A[1,j]*A[1,j];
     Writeln('Сумма X2i = ',x2i);
     For j:=1 to 5 do
     x3i:=x3i+A[1,j]*A[1,j]*A[1,j];
     Writeln('Сумма X3i = ',x3i);
     For j:=1 to 5 do
     x4i:=x4i+A[1,j]*A[1,j]*A[1,j]*A[1,j];
     Writeln('Сумма X4i = ',x4i);
     For j:=1 to 5 do
     xiyi:=xiyi+A[1,j]*A[2,j];
     Writeln('Сумма X1iY1i = ',xiyi);
     For j:=1 to 5 do
     x2iyi:=x2iyi+A[1,j]*A[1,j]*A[2,j];
     Writeln('Сумма X2iY1i = ',x2iyi);
     det:=3*x2i*x4i+xi*x3i*x2i+xi*x3i*x2i-x2i*x2i*x2i-xi*xi*x4i-x3i*x3i*3;
     det1:=yi*x2i*x4i+xiyi*x3i*x2i+xi*x3i*x2iyi-x2iyi*x2i*x2i-xiyi*xi*x4i-x3i*x3i*yi;
     det2:=3*xiyi*x4i+yi*x3i*x2i+xi*x2iyi*x2i-x2i*xiyi*x2i-xi*yi*x4i-x3i*x2iyi*3;
     det3:=3*x2i*x2iyi+xi*xiyi*x2i+xi*x3i*yi-x2i*x2i*yi-xi*xi*x2iyi-x3i*xiyi*3;
     Writeln('Определитель =',det);
     Writeln('Определитель 1 =',det1);
     Writeln('Определитель 2 =',det2);
     Writeln('Определитель 3 =',det3);
     ao:=det1/det;
     bo:=det2/det;
     co:=det3/det;
     Writeln('A =',ao);
     Writeln('B =',bo);
     Writeln('C =',co);
     Writeln('y=',ao,'+',bo,'x+',co,'x2');
end.

        