import math
n,k=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(n)]
l,r=-1,10**19
while r-l>1:
    m=(l+r)//2
    b=0
    for w,d in a:
        b+=(m-w+d)//d
    if b<k:
        l=m
    else:
        r=m
print(r+1)