/*I MAY NOT GET THE SUCCESS IMMEDIATELY BUT I WILL GET IT FOR SURE*/
#include<bits/stdc++.h>
#define opt std::ios_base::sync_with_stdio(false)
#define I int
#define li		int32_t
#define lli		long long
#define ulli unsigned long long
 
#define pn			 printf("\n")
#define nl			 cout<<'\n'
#define sf(N)        scanf("%lld",&N)
#define pf(N)        printf("%lld",N)
#define sf1(N1,N2)    scanf("%lld %lld",&N1,&N2)
#define pf1(N1,N2)    printf("%lld %lld",N1,N2)
#define sf2(N1,N2,N3) scanf("%lld %lld %lld",&N1,&N2,&N3)
#define pf2(N1,N2,N3) printf("%lld %lld %lld",N1,N2,N3)
 
#define sl          cout<<' '
#define ps          printf(" ")
 
#define rep(i,a,b)	for(i=a;i<b;i++)
#define repr(i,a,b)	for(i=a;i>b;i--)
#define elif		else if
#define mset(a,b)	memset(a,b,sizeof(a))
 
#define pb		push_back
#define pob		pop_back
#define itr		iterator
#define sz()	size()
#define szof    sizeof
#define lb		lower_bound
#define ub		upper_bound
#define mp		make_pair
#define vlli    vector<lli>
#define plli	pair<lli,lli>
#define vplli	vector<plli >
#define F   	first
#define S		second
#define Dup     erase(unique(V.begin(),V.end()),V.end())
 
#define bs      binary_search
#define ub      upper_bound
#define lb      lower_bound
 
#define ALL(V)  V.begin(),V.end()
 
#define MX1     100000LL
#define MX2     1000000LL
#define Inf     5000000000000000000LL
#define mod		1000000007LL
using namespace std;
 
lli Power(lli a,lli b)
{
    lli result=1;
 
    while(b)
    {
        if(b%2)
        {
            result=(result*a)%mod;
        }
 
        b=b>>1;
        a=(a*a)%mod;
    }
 
 return result;
}
 
int main()
{
    opt;
 
    /*#ifndef ONLINE_JUDGE
    freopen("double_squares.txt","r",stdin);
    freopen("double_squares_out.txt","w",stdout);
    #endif // ONLINE_JUDGE*/
 
    lli N,K,i;
    cin>>N>>K;
 
    vlli V(N),V1(N);
 
    rep(i,0,N)
    {
        cin>>V[i]>>V1[i];
    }
 
    ulli Store=0,low=0,high=Inf;
 
    while(low <= high)
    {
        lli mid=(low+high)/2;
        lli Sum=0;
 
        //cout<<mid<<' ';
 
        rep(i,0,N)
        {
            lli x;
 
            if(mid<V[i])
            {
                x=0;
            }
            else
            {
                x=(mid-V[i])/(V1[i]);
 
                x++;
            }
 
            Sum+=x;
            if(Sum>=K) break;
        }
 
        if(Sum >= K)
        {
            high=mid-1;
            Store=mid;
        }
        else
        {
            low=mid+1;
        }
    }
 
    cout<<Store;
 
 
 
 
 return 0;
}