#include #include using namespace std; typedef long long LL; struct X{ LL A; LL B; }; int main(int argc, char* argv[]) { LL N,K,i; cin>>N>>K; vector AB(N); LL A1,B1; for (i=0;i>AB[i].A>>AB[i].B; } LL k=0; LL M=1; while (true){ for (i=0;i=AB[i].A && M<=AB[i].B){ k++; } if (k==K){ cout<