#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int n, k; cin >> n >> k; vector a(n), b(n); for(int i=0; i> a[i] >> b[i]; int left = 1; int right = 1000000001; while(1 < right - left){ int mid = (left + right) / 2; long long cnt = 0; for(int i=0; i