#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 2LL*1e18;
const ll MAX_N = 100010;
 
int main() {
    ll n, k;
    cin >> n >> k;
    
    vl w(n), d(n);
    rep(i, n) {
        cin >> w[i] >> d[i];
    }

    // 判定問題「位置x以下にk個以上花があるか？」を二分探索で解く
    ll left = -1;
    ll right = INF;
    while(right - left > 1) {
        ll x = (left + right)/2;
        ll cnt = 0;
        rep(i, n) {
            if(x < w[i]) {
                continue;
            }
            cnt++;
            cnt += (x - w[i])/d[i];
            if(cnt >= k) {
                break;
            }
        }
        if(cnt >= k) {
            right = x;
        }
        else {
            left = x;
        }
    }

    out(right);
    re0;
}