program ex;
type
sz=array[1..10000]of longint;
ss=array[0..100]of longint;
var
f,c,y:sz;
f1,f2:text;
n,s:integer;
t:ss;
procedure init;
var
i,j:integer;
begin
assign(f1,'factory.in');
assign(f2,'factory.out');
reset(f1);
rewrite(f2);
readln(f1,n,s);
for i:=1 to n do
readln(f1,c[i],y[i]);
close(f1);
end;
procedure main;
var
i,j,x,k:longint;
begin
x:=0;
k:=1;
f[1]:=c[1]*y[1];
for i:=2 to n do
if (c[k]+s*(i-k))<c[i] then f[i]:=(c[k]+s*(i-k))*y[i]
else begin
f[i]:=c[i]*y[i];
k:=i;
end;
end;
procedure add;
var
i,j,x:longint;
begin
for i:=1 to n do
begin
j:=1;
t[1]:=t[1]+f[i];
x:=f[i];
while x>=10 do
begin
t[j+1]:=t[j+1]+t[j] div 10;
t[j]:=t[j] mod 10;
x:=x div 10;
inc(j);
end;
if j>t[0] then t[0]:=j;
end;
end;
procedure print;
var
i:integer;
begin
add;
for i:=t[0] downto 1 do
write(f2,t[i]);
end;
begin
init;
main;
print;
close(f2);
end.