Var
a,b,n,i:integer;
x,y,S:real;
Begin
Write('a = ');ReadLn(a);
Write('b = ');ReadLn(b);
Write('n = ');ReadLn(n);
WriteLn('i':3,'x':10,'y':9);
S:=0;
For i:= 0 to n do
Begin
x:=a+(b-a)*i/n;
y:=Cos(Sqrt(Abs(2*x)));
WriteLn(i:3,x:10:1,'':6,y:5:2 );
if y < 0 then S:=S+y;
End;
WriteLn('S = ',S:0:2);
End.