import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

immutable long inf = 3L * 10L^^18;

void main() {
    int n, k;
    scan(n, k);
    auto w = new long[](n);
    auto d = new long[](n);

    foreach (i ; 0 .. n) {
        scan(w[i], d[i]);
    }

    bool check(long x) {
        long hana;

        foreach (i ; 0 .. n) {
            if (x - w[i] >= 0) {
                hana += (x - w[i]) / d[i] + 1;
            }
        }

        return hana >= k;
    }

    long btm = 0, top = inf;

    while (top - btm > 1) {
        long mid = btm + (top - btm) / 2;

        if (check(mid)) {
            top = mid;
        }
        else {
            btm = mid;
        }
    }

    writeln(top);
}

void solve(int n, int v, int w) {
    if (n == 1) {
        writeln(min(v, w));
        return;
    }

    auto va = new int[](0);
    va ~= v;

    while (v > 1) {
        if (v % n <= 1) {
            v /= n;
        }
        else {
            v = (v / n) + 1;
        }

        va ~= v;
    }

    va.reverse();

    auto wa = new int[](0);
    wa ~= w;

    while (w > 1) {
        if (w % n <= 1) {
            w /= n;
        }
        else {
            w = (w / n) + 1;
        }

        wa ~= w;
    }

    wa.reverse();

    debug {
        writeln(va);
        writeln(wa);
    }

    int ans = 0;

    while (!va.empty) {
        while (!wa.empty) {
            if (va.front == wa.front) {
                ans = max(ans, va.front);
                va.popFront;
                wa.popFront;
                break;
            }
            else if (va.front < wa.front) {
                va.popFront;
                break;
            }
            else {
                wa.popFront;
            }
        }
    }

    writeln(ans);
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}