.


   air conditioner in Tanzania          


Function fx(x : real) : real; { . [3, 4] }

begin { . . 0.00001 }

fx := sin(0.2*x - 3)/(x*x + 1)

end;

{----------------------------------------------------------------------------------------}

{ - - }

Function t(eps : real) : integer;

var

k : integer;

begin

k := -1;

repeat

eps := eps*10;

k := k + 1

until eps > 1;

t := k

end;

{----------------------------------------------------------------------------------------}

{ - }

Function I(n : longint; a, b : real) : real;

var

x, f : real;

k : longint;

begin

randomize;

f := 0;

for k := 1 to n do

begin

x := random*(b - a) + a;

f := f + fx(x)

end;

I := (b - a)*f/n

end;

{----------------------------------------------------------------------------------------}

{ }

begin

write(' '); readln(a);

write(' '); readln(b);

write(' '); readln(eps);

n := 10;

repeat

n := 2*n

until abs(I(n, a, b) - I(2*n, a, b)) <= eps;

writeln(' ', I(2*n, a, b):6:t(eps));

writeln(' ', eps:1:t(eps));

end.