7.0



8.4. - - 2


:

,

;
;

;

.

1.

.

Program P1_P;

Type

Vect = array[1..20) of real;

Var

X, Y: Vect;

i: integer;

Dx, Dy, D: real;

Procedure Mod_Otkl (A: Vect; n: integer; var Da: real);

var

ma, sa: real;

i: integer;

begin

ma := -1E6;

sa := 0;

for i := 1 to n do

begin

if a[i]>ma then ma := a[i];

sa := sa + a[i];

end;

sa := sa/n;

Da := abs(ma - sa);

end;

Begin { }

writeln( X);

for i :=1 to 8 do read(x[i]);

writeln( Y);

for i := 1 to 20 do read(y[i]);

Mod_Otkl(X, 8, Dx);

Mod_Otkl(Y, 20, Dy);

D := Dx / Dy;

writeln(D=, D:6:2);

End.

2.

.

Program P1_F;

Type

Vect = array[1..20) of real;

Var

X, Y: Vect;

i: integer;

Dx, Dy, D:real;

Function Mod_Otkl (A: Vect; n: integer): real;

var

ma, sa, Da: real;

i: integer;

begin

ma := -1E6;

sa:=0;

for i :=1 to n do

begin

if a[i]>ma then ma := a[i];

sa := sa +a i];

end;

sa := sa / n;

Da := abs(ma - sa);

Mod_Otkl := Da;

end;

Begin { }

writeln( X);

for i := 1 to 8 do read(x[i]);

writeln( Y);

for i := 1 to 20 do read(y[i]);

Dx := Mod_Otkl(X, 8);

Dy := Mod_Otkl(Y, 20);

D := Dx / Dy;

writeln(D=, D:6:2);

End.