Pagini recente » Cod sursa (job #1966889) | Cod sursa (job #691410) | Cod sursa (job #3140687) | Cod sursa (job #689411) | Cod sursa (job #450354)
Cod sursa(job #450354)
var c,s,d,i,j:longint;
function prime(a,b:longint):boolean;
var k,i:longint;
begin
k:=trunc(sqrt(a));
prime:=true;
for i:=2 to a do
if a mod i=0 then
begin
if b mod i=0 then
begin
prime:=false;
break;
end;
a:=a div i;
while a mod i=0 do
a:=a div i;
end;
if (a<>1) and (b mod a=0) then prime:=false;
end;
begin
assign(input,'mins.in');
assign(output,'mins.out');
reset(input);
rewrite(output);
readln(c,d);
for i:=1 to d-1 do
for j:=1 to c-1 do
if prime(i,j)=true then inc(s);
writeln(s);
close(output);
end.