#include using namespace std; int main(){ int n,k;cin>>n>>k; int a[n],b[n]; for(int i=0;i>a[i]>>b[i]; } int u=1000000001,d=1; while(u-d>1){ int mid=(u+d)/2; long long sum=0; for(int i=0;imid)continue; sum+=min(b[i]+1,mid)-a[i]; } if(sum>=k)u=mid; else d=mid; } cout<