I don't know why I'm getting wrong answer ,is my approach wrong

#include
#include
using namespace std;

int main()
{
int no;
cin>>no;
while(no–)
{
int n,a,b;
cin>>n;
vector<pair<int,int>>v;
for(int i=0;i<n;i++)
{
cin>>a>>b;
v.push_back(make_pair(a,b));
}

   int ans=0,min1=-1;
   ans=(v[0].first)*(v[0].second);
   min1=v[0].first;
   for(int i=1;i<n;i++)
   {
         if(min1>v[i].first)
         {
             min1=v[i].first;
         }
         ans=ans+(v[i].second)*min1;
   }
   cout<<ans<<endl;
}

}

Please relay your idea, it is not very clear from the code.
Also please paste your code somewhere and share the link.