Cod sursa(job #574931)
Utilizator | Data | 7 aprilie 2011 18:26:04 | |
---|---|---|---|
Problema | Mins | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
var s,k:qword;
x,y,j:longint;
begin
assign(input,'in.txt');reset(input);
assign(output,'out.txt');rewrite(output);
readln(x,y);
s:=(x-1)*(y-1);
for j:=2 to y-1 do
begin
k:=j;
while (x-1) div k>0 do
begin
s:=s-(x-1) div k;
k:=k*j;
end;
end;
writeln(s);
end.