label stop;
var j,i,n,m:integer;
S1,S2,X0,X1,t1,t2,h,r,f:real;
l:char;
X,Y,K,Z,f1,f2 :ARRAY[1..100]of real;
Begin
repeat
write('nhap so vong lap n= ');readln(n);
write('nhap luu luong cua nguyen lieu (kmol/h)=');readln(f);
write('Nhap so cau tu m= ');readln(m);
writeln('Nhap hang so can bang');
for i:=1 to m do
begin
write('K[',i,']=');
readln(K[i]);
end;
writeln('Nhap thanh phan nguyen lieu nap');
for i:=1 to m do
begin
write('Z[',i,']=');
readln(Z[i]);
end;
(************************************************************************)
x1:=0;
x0:=0;
t1:=0;
t2:=0;
h:=0;
j:=0;
repeat
t1:=0;
s1:=0;
s2:=0;
j:=j+1;
for i:=1 to m do
begin
F1[i]:=Z[i]*(K[i]-1)/(X0*(K[i]-1)+1);
s1:=s1+f1[i];
f2[i]:=(-Z[i]*sqr(K[i]-1))/sqr((X0*(K[i]-1)+1)) ;(* Tinh dao ham *)
s2:=s2+f2[i];
end;
x1:=x0-s1/s2;
x0:=x1;
for i:=1 to m do
begin
F1[i]:=Z[i]*(K[i]-1)/(x1*(K[i]-1)+1);
t1:=t1+f1[i];
end;
if j> n then goto stop;
until abs(t1)0.9999) and (x11 then writeln('He ton tai o the hoi')
else writeln('He ton tai o the long');
readln;
end;
stop:if j>n then
begin
writeln('t1=' ,t1);
writeln('khong the tinh Flash');
end;
writeln('Co tiep tuc khong(y/n)?');
readln(l);
until (l='n') or (l='N');
End.