program dgv;
uses crt;
var x,y,z,n,i: integer;
p,S,A: real;
begin
clrscr;
writeln('Nhap x: '); read(x);
writeln('Nhap y: '); read(y);
writeln('Nhap z: '); read(z);
writeln('Nhap n: '); read(n);
if x mod 2 = 0 then write (x,' la so chan') else writeln(x,'la so le');
if y mod 2 = 0 then write (y,' la so chan') else writeln(y,'la so le');
if z mod 2 = 0 then write (z,' la so chan') else writeln(z,'la so le');
if n mod 2 = 0 then write (n,' la so chan') else writeln(n,'la so le');
if n mod 3 <> 1 then writeln('Tong khong co quy luat') else
begin
S:=0;
for i:= 0 to (n-1)/3 do
S:= S+(3i+1);
writeln('S = ',S);
A:=0;
p:=1;
for i:=1 to n do
begin
p:= p*(x/(x+y));
A:=A+p;
end;
writeln('A = ',A);
readln
end.