#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define eps LDBL_EPSILON
#define moder 1000000007
#define int long long
#define double long double
#define ll long long
#define INF LLONG_MAX/3
#define P pair<int,int>
#define prique priority_queue<int,vector<int>,greater<int>>
#define ggr getchar();getchar();return 0
using namespace std;
int n,k,w[100010],d[100010];
bool func(int m){
	int cnt=0;
	rep(i,n){
		if(m-w[i]>=0)cnt+=(m-w[i])/d[i]+1;
		if(cnt>=k)return false;
	}
	return true;
}
signed main(){
	cin>>n>>k;
	rep(i,n)cin>>w[i]>>d[i];
	int mi=0,ma=LLONG_MAX;
	while(ma-mi>1){
		int md=mi+(ma-mi)/2;
		if(!func(md))ma=md;
		else mi=md;
	}
	if(func(mi-1)&&!func(mi))cout<<mi<<endl;
	else if(func(mi)&&!func(ma))cout<<ma<<endl;
	else cout<<ma+1<<endl;
	ggr;
}