#include "iostream"
using namespace std;
int main()
{
int TestCase;
while (cin >> TestCase && TestCase != -1)
{
int s, t, temp = 0, ans = 0;
for (int i = 0; i < TestCase; i++)
{
cin >> s >> t;
ans += s * (t - temp);
temp = t;
}
cout << ans << " miles" << endl;
}
}
zoj 2176 Speed Limit
最新推荐文章于 2012-11-05 23:29:06 发布