program p1;
var F,x,S,eps,a:real;
n:integer;
begin
write('Vvedite a=');
readln(a);
write('Vvedite x=');
readln(x);
write('Vvedite eps=');
readln(eps);
F:=1/2*a;
n:=1;
S:=a*cos(n*x)/(sqr(a)-sqr(n));
while abs(S)>eps do
begin
F:=F+S;
n:=n+1;
if n mod 2=0 then S:=-(a*cos(n*x)/(sqr(a)-sqr(n)))
else S:=a*cos(n*x)/(sqr(a)-sqr(n));
end;
write('pri x=',x:5:2,' a=',a:5:2,' eps=',eps:7:4,' summa F=',F:7:3);
readln;
end.