Var
x, y, z, p, q, a: longint;
fin, fout: Text;
begin
Assign(fin, 'input.txt');
Reset(fin);
Readln(fin, z, p, q);
Close(fin);
Assign(fout, 'output.txt');
Rewrite(fout);
if z <= 1 then Writeln(fout, 'no')<br> else
if (z mod p <> 0) or (z mod q <> 0) or (p * q > z) then Writeln(fout, 'no')
else
if z = p * q then Writeln(fout, p, ' ', q)
else begin
a := z;
x := 1;
while (a mod p = 0) do
begin
x := x * p;
a := a div p
end;
a := z div x;
y := 1;
while (a mod q = 0) do
begin
y := y * q;
a := a div q
end;
a := z div (y * x);
if a = 1 then Writeln(fout, x, ' ', y)
else Writeln(fout, 'many')
end;
Close(fout)
end.
Скачать вложение Текст (TXT)
Скачать вложение Текст (TXT)