program batch;
const
maxn = 5000;
var
n,s: longint;
T,F: array[0..maxn] of longint;
opt,sumT,sumF: array[0..maxn] of int64;
i,j: longint;
tmp,inf: int64;
begin
assign(input,'batch.in'); reset(input);
assign(output,'batch.out'); rewrite(output);
readln(n);
readln(s);
for i :=1 to n do readln(T[i],F[i]);
for i :=1 to n do sumT[i] :=sumT[i-1] + T[i];
for i :=1 to n do sumF[i] :=sumF[i-1] + F[i];
inf :=1; for i :=1 to 16 do inf :=inf *10;
for i :=1 to n do opt[i] :=Inf;
for i :=1 to n do
for j :=0 to i-1 do begin
tmp :=opt[j] + (s + (sumT[i]-sumT[j])) * (sumF[n]-sumF[j]);
if tmp <opt[i] then opt[i] :=tmp;
end;
writeln(opt[n]);
close(input); close(output);
end.