#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int main()
{
    int N, K; cin >> N >> K;
    vector<Int> W(N), D(N);
    for (int i = 0; i < N; i++) cin >> W[i] >> D[i];
    Int ng = 0, ok = W[0] + D[0] * K;
    while (ok - ng > 1) {
        Int place = (ok + ng) / 2;
        Int cnt = 0;
        for (int i = 0; i < N; i++) {
            if (place < W[i]) continue;
            cnt += (place - W[i]) / D[i] + 1;
        }
        (cnt >= K ? ok : ng) = place;
    }
    cout << ok << endl;
    return 0;
}