procedure TForm1.Button1Click(Sender: TObject);
var
bmax,cmax,b,c, delta1,delta2,gcd : integer;
begin
bmax:=strtoint(edit1.Text);
cmax:=strtoint(edit2.Text);
richedit1.Text:='';
for b:=1 to bmax do
for c:=1 to cmax do
begin
canvas.textout(200,300,inttostr(round(b/bmax*100))+'%');
delta1:=b*b-4*c;
delta2:=b*b+4*c;
if (delta1>=0) and (delta2>=0) then
if (sqrt(delta1/1)=int(sqrt(delta1/1))) and (sqrt(delta2/1)=int(sqrt(delta2/1))) then
begin
     pgcd(b,c,gcd);
     if gcd=1 then richedit1.Text:=richedit1.Text+inttostr(b)+';'+inttostr(c)+'--> ('+inttostr(round((b-sqrt(delta1))/2))+';'+inttostr(round((b+sqrt(delta1))/2))+') & ('+inttostr(round((b-sqrt(delta2))/2))+';'+inttostr(round((b+sqrt(delta2))/2))+')'+chr(13);
end;
end;
end;