Lời giải:
program hotrotinhoc;
var max,min,i,x,k: integer;
begin
write('X='); readln(x);
write('K='); readln(k);
min:=32000; max:=0;
for i:=1 to x do if (x mod i=0) then
begin
(min>i) then min:=i;
if (max<i) then max:=i;
end;
writeln(min,' ',max);
write(sqr(x),' ',k-x);
readln
end.