Pagini recente » Cod sursa (job #1089217) | Cod sursa (job #746580) | Cod sursa (job #1608434) | Cod sursa (job #1885109) | Cod sursa (job #1134509)
var d:array[0..500001] of int64;
i,j,a,b,k,n,rs:longint;
buf1:array[1..1 shl 17] of char;
begin
assign(input,'divk.in');
assign(output,'divk.out');
reset(input);
rewrite(output);
settextbuf(input,buf1);
readln(n,k,a,b);
for i:=1 to n do
begin
readln(d[i]);
inc(d[i],d[i-1]);
end;
for i:=a to b do
for j:=i to n do
if (d[j]-d[j-i]) mod k=0 then inc(rs);
writeln(rs);
close(input);
close(output);
{Totusi este trist in lume}
end.