#include using namespace std; int main(){ int n,k; cin>>n>>k; int a,b; vector> v; for(int i=0;i>a>>b; v.push_back(make_pair(a,0)); v.push_back(make_pair(b,1)); } sort(v.begin(),v.end()); int c=0; int t=1; int p=0; p=v[0].first; for(int i=1;i=k){ cerr<=k){ cerr<