#include<bits/stdc++.h>
using namespace std;
long long ans;
int n, s, c, y;
int main()
{
cin >> n >> s;
cin >> c >> y;
ans = c * y;
int minn = c;
for(int i = 1; i < n; i++)
{
cin >> c >> y;
minn = min(minn + s, c);//计算本周最小的花费
ans += minn * y;
}
cout << ans << endl;
return 0;
}
因篇幅问题不能全部显示,请点此查看更多更全内容