var
a,d:array[0..11000]of longint;
i,j,k,l,m,n,t:longint;
ans:int64;
procedure down(i:longint);
var
j,aa,dd:longint;
begin
aa:=a[i];
dd:=d[i];
while i*2<=n do
begin
j:=i*2;
if (j<n)and(a[j+1]>a[j]) then inc(j);
if a[j]>aa then
begin
a[i]:=a[j];
d[i]:=d[j];
i:=j;
end else break;
end;
a[i]:=aa;
d[i]:=dd;
end;
begin
assign(input,'fisha.in');reset(input);
assign(output,'fisha.out');rewrite(output);
read(n,m,t,k);
for i:=1 to n do read(a[i],d[i]);
for i:=n div 2 downto 1 do down(i);
m:=m-t*(n-1);
if m mod k=0 then m:=m div k-1 else m:=m div k;
while m>0 do
begin
ans:=ans+a[1];
a[1]:=a[1]-d[1];
if a[1]<0 then a[1]:=0;
dec(m);
down(1);
end;
writeln(ans);
close(input);close(output);
end.