#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const LL mod=1000000007;
const LL LINF=1LL<<62;
const int INF=1<<30;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};



int main(){
    LL n,k;cin >> n >> k;
    vector<LL> w(n),d(n);
    for (int i = 0; i < n; i++) {
        cin >> w[i] >> d[i];
    }
    LL l = 0,r = LINF;
    while(abs(r - l) > 1){
        LL m = (r - l) / 2 + l;
        auto f = [&](LL m){
            LL cnt = 0;
            for (int i = 0; i < n; i++) {
                if(m - w[i] < 0) continue;
                cnt += (m - w[i]) / d[i] + 1;
                if(cnt >= k) return true;
            }
            return false;
        };
        if(f(m)) r = m;
        else l = m;
    }
    cout << r << endl;
    return 0;
}
