Pagini recente » Rating Manoila Alex (Peel3) | Istoria paginii runda/training_day_8./clasament | Istoria paginii runda/training_day_8./clasament | Cod sursa (job #1623669) | Cod sursa (job #290084)
Cod sursa(job #290084)
var f,g:text;
mm,i,ct,a,b:longint;
function comb(n,k:longint):longint;
begin
comb:=1;
if (n>=0) and (k>=0) and (n>=k) then
comb:=comb(n-1,k-1)+comb(n-1,k)
else
comb:=1;
end;
BEGIN
assign(f,'pascal.in');
reset(f);
read(f,a,b);
close(f);ct:=0;
for i:= 0 to a do
begin
{ mm:=comb(a,i);}
if comb(a,i) mod b = 0 then
ct:=ct+1;
end;
assign(g,'pascal.out');
rewrite(g);
writeln(g,ct);
close(g);
END.