#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
最新推荐文章于 2017-01-15 15:52:26 发布