the task is: without storage to find the two minimum numbers, sum of whose squares >500. a fragment of my program in Pascal :
for i:=1 to n do begin
phony (f, a);
if (a<min1) then begin min2:=min1; min1:=a; end;
if (a>min1) and (a<min2) then min2:=a;
how to check the squares? she can not figure out. it is desirable to describe the algorithm in Pascal, or simply to explain the words. thank you in advance.