#include using namespace std; using ll = long long; #define fi first #define se second int main(){ int n,k; cin >> n >> k; vector> v(n); for(int i=0;i < n;i++) { cin >> v.at(i).fi >> v.at(i).se; }//input int no=0,yes=pow(10,9); while(abs(no-yes)>1){ int cnt=0,c=(no+yes)/2; for(int i=0;i < n;i++) { cnt+=min(c,v.at(i).se)-min(v.at(i).fi,c)+1; if(cnt>=k){ yes=c; break; } } if(cnt