#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18)*2;
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
V<P> a;
ll n,k;
bool C(ll m){
    ll cnt=0;
    for(int i=0;i<n;i++){
        if(a[i].fi>m)continue;
        cnt+=(m-a[i].fi)/a[i].se+1;
        if(cnt>=k)return true;
    }
    return false;
}
int main(){
    cin>>n>>k;
    a.resize(n);
    for(int i=0;i<n;i++)cin>>a[i].fi>>a[i].se;
    ll l=0,r=inf;
    while(r-l>1){
        ll mid=(l+r)/2;
        if(C(mid))r=mid;
        else l=mid;
    }
    cout<<r<<endl;
}