//PascalABC.NET 3.2 сборка 1318
var
n, m, max, k, i: integer;
ar: array of integer;
function CountOfDel(n: integer): integer;
var
i, k: integer;
begin
if n>0 then
begin
for i := 1 to n do
if n mod i = 0 then inc(k);
end
else
for i:= n to -1 do
if n mod i = 0 then
inc(k);
CountofDel := k;
if n=0 then
CountofDel:=0;
end;
begin
readln(n, m);
k := 0;
max := 0;
for i := n to m do
begin
if CountOfDel(i)=0 then
begin
writeln('0');
exit;
end;
if CountOfDel(i) > max then
begin
k := 1;
setlength(ar, k);
ar[k - 1] := i;
max := CountOfDel(i);
end
else
if CountOfDel(i) = max then
begin
inc(k);
setlength(ar, k);
ar[k - 1] := i;
end;
end;
for i := 0 to k - 1 do
write(ar[i]:4);
end.
Пример ввода:
1 10
Пример вывода:
6 8 10