a:array[0..1001] of longint;
f,b:array[-12..200000] of longint;
begin
readln(n);
readln(s,t,m); a[m+1]:=n;
for i:=1 to m do read(a[i]); readln;
for i:=1 to m do
for j:=i to m do
if a[i]>a[j] then begin
tot:=a[i]; a[i]:=a[j]; a[j]:=tot; end;
for i:=1 to m+1 do begin
if a[i]-a[i-1]>12 then a[i]:=a[i-1]+12;
end;
for i:=1 to m do f[a[i]]:=1;
for e:=s to t do b[e]:=1;
b[0]:=1;
for i:=1 to a[m+1] do
if b[i]<>0 then begin
tot:=9999;
for e:=i+s to i+t do b[e]:=1;
for j:=i-t to i-s do begin
if (tot>f[i]+f[j]) and (b[j]<>0) then tot:=f[i]+f[j];
end;
f[i]:=tot;
end;
writeln(f[a[m+1]]);
end.
这样不行的,改成 if a[i]-a[i-1]>100 then a[i]:=a[i-1]+100;
tot:=9999;改为 tot:=maxlongint div 2;