#include<bits/stdc++.h>
#define int unsigned long long
using namespace std;
int n,k,ans=1LL,bj[200005]={0};
struct node
{
int x;
int y;
};
node a[200005];
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n>>k;
for(int i=1;i<=n;i++)
{
cin>>a[i].x>>a[i].y;
}
for(int i=1;i<=k;i++)
{
int maxx=0,mj=0;
for(int j=1;j<=n;j++)
{
//cout<<j<<" "<<ans*a[j].x+a[j].y<<" "<<bj[j]<<"\n";
if(ans*a[j].x+a[j].y>maxx&&bj[j]==0)
{
maxx=ans*a[j].x+a[j].y;
mj=j;
}
}
bj[mj]=1;
ans=maxx;
//cout<<ans<<"\n";
}
cout<<ans;
return 0;
}
/*
2 2
50 100
100 1000
*/