#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll w[100000],d[100000];
int n,k;

bool C(ll x){
	ll cnt=0;
	rep(i,n){
		if(x<w[i])continue;
		cnt+=(x-w[i])/d[i]+1;
		if(cnt>=k)return true;
	}
	return false;
}
int main(){
	scanf("%d%d",&n,&k);
	rep(i,n)scanf("%lld%lld",&w[i],&d[i]);
	ll l=0,r=LLONG_MAX/2;
	while(l!=r){
		ll t=(l+r)/2;
		if(C(t))r=t;
		else l=t+1;
	}
	cout<<l<<endl;
}