#include <bits/stdc++.h>

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

using namespace std;
typedef unsigned long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 5e18+7;


int main(){
	//ios_base::sync_with_stdio(false);
	ll N, K, ans=0;
	ll w[100005], d[100005];

	cin >> N >> K;
	rep(i,N) cin >> w[i] >> d[i];

	ll l=0, r=INF;
	while(r-l>1){
		ll m = (l+r)/2ll;
		ll sum = 0;
		rep(i,N) if(w[i] <= m){
			sum += (m-w[i]) / d[i] + 1ll;
			sum = min(sum, INF);
		}
		(sum >= K ? r : l) = m;
	}

	ans = r;
	cout << ans << endl;

	return 0;
}
