Begin
var A:=ReadInteger();
var B:=ReadInteger();
var x1,x2: integer;
var x:integer;
x:=2;
while (x <= 2*10 ** 9) do
begin
if((x mod A=1) and (x mod B=B-1)) then
break;
x+=1;
end;
Writeln(x);
End.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Begin
var A:=ReadInteger();
var B:=ReadInteger();
var x1,x2: integer;
var x:integer;
x:=2;
while (x <= 2*10 ** 9) do
begin
if((x mod A=1) and (x mod B=B-1)) then
break;
x+=1;
end;
Writeln(x);
End.