uses math;
var st,sf:array[0..5000]of longint;
f:array[1..5001]of longint;
i,j,k,l,m,n,s,t,ff:longint;
begin
assign(input,'batch.in');
assign(output,'batch.out');
reset(input);rewrite(output);
readln(n);
readln(s);
for i:=1 to n do
begin
readln(t,ff);
st[i]:=st[i-1]+t;
sf[i]:=sf[i-1]+ff;
end;
for i:=n downto 1 do
begin
f[i]:=maxlongint;
for j:=i to n do
begin
f[i]:=min(f[i],f[j+1]+(st[j]-st[i-1]+s)*(sf[n]-sf[i-1]));
end;
end;
writeln(f[1]);
close(input);close(output);
end.