#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
using namespace std;

int main() {
        int n;
        long long k;
        scanf("%d%lld", &n, &k);
        vector<pair<long long, long long>> fl(n);
        for (int i = 0; i < n; i ++) {
                scanf("%lld%lld", &fl[i].first, &fl[i].second);
        }
        long long lb = 0, ub = 2LL * 1e18 + 1;
        while (ub - lb > 1) {
                long long x = (lb + ub) / 2;
                long long cnt = 0;
                for (int i = 0; i < n; i ++) {
                        if (fl[i].first > x) continue;
                        long long get = (x - fl[i].first + fl[i].second - 1) / fl[i].second;
                        cnt += get;
                }
                if (cnt > k - 1) ub = x;
                else lb = x;
        }
        printf("%lld\n", lb);
        return 0;
}

