Sunday, May 1, 2016

Codeforces 588A - Duff and Meat

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n , a , b , sum=0, mn=101;
    while(cin>>n){
        for(int i=0; i<n; i++){
            cin>>a>>b;
            mn=min(mn,b);
            sum+=mn*a;
        }
        cout<<sum<<endl;
        mn=0, sum=0;
    }

    return 0;
}

No comments:

Post a Comment