Pagini recente » Cod sursa (job #950549) | Cod sursa (job #2752420) | Cod sursa (job #942802) | Cod sursa (job #1511149) | Cod sursa (job #7125)
Cod sursa(job #7125)
const maxn = 1000;
modulo = 194767;
var f:text;
n,k,s,i,j,sol,max:longint;
c:array[0..maxn]of longint;
procedure readdata;
begin
assign(f,'1-sir.in');
reset(f);
readln(f,n,k);
s:=n*(n-1) div 2;
s:=s-k;
sol:=0;
if s mod 2<>0 then
begin
sol:=-1;
end;
s:=s div 2;
close(f);
end;
procedure solve;
begin
c[0]:=1;
max:=0;
for i:=1 to n-1 do
begin
for j:=max downto 0 do
begin
if c[j]<>0 then
begin
if (i+j<=s) then c[i+j]:=(c[i+j]+c[j]) mod modulo;
end;
end;
max:=max+i;
end;
end;
procedure writedata;
begin
assign(f,'1-sir.out');
rewrite(f);
if sol<>-1 then writeln(f,c[s])
else writeln(f,0);
close(f);
end;
begin
readdata;
solve;
writedata;
end.