Pagini recente » Cod sursa (job #1389061) | Cod sursa (job #2448064) | Cod sursa (job #1157618) | Cod sursa (job #2149390) | Cod sursa (job #125595)
Cod sursa(job #125595)
var f,g:text;
a,b,m,nr,x,y:int64;
i:longint;
{}
function ok(nr:int64):boolean;
var i:byte;
begin
ok:=true;
while nr <> 0 do begin
if nr mod 10 >1 then begin ok:=false; break; end;
nr:=nr div 10;
end;
end;
{}
begin
assign(f,'multiplu.in'); reset(f);
assign(g,'multiplu.out'); rewrite(g);
readln(f,a,b);
x:=a; y:=b;
while a <> b do
if a <b then a:=a+x else
b:=b+y;
nr:=a;
for i := 1 to 10000000 do
if ok(nr*i) then begin
writeln(g,nr*i);
break;
end;
close(f);
close(g);
end.