program factory(input,output); // gao jing du(X) int64 ke yi jie jue wen ti ;
var
i,j,k:longint;
n:longint;
s:longint;
min,now:int64;
temp:int64;
c:array [1..5000] of int64;
y:array [1..10000] of int64;
ans:int64;
begin
assign(input,'factory.in');
assign(output,'factory.out');
reset(input);
rewrite(output);
readln(n,s);
for i:=1 to n do
readln(c[i],y[i]);
ans:=c[1]*y[1];
for i:=2 to n do begin
min:=2147000000;
for j:=1 to i-1 do
begin
now:=(c[j]+(i-j)*s)*y[i];
if (now<min) then min:=now;
end;
if c[i]*y[i]<min then min:=c[i]*y[i];
ans:=ans+min;
end;
writeln(ans);
close(input);
close(output);
end.