#include <iostream> using namespace std; const int maxn = 100005; int n; long long k; int a[maxn], b[maxn]; int *upper_bound(int *a, int *an, int ai) { int l = 0, r = __(1)__ ; while (l < r) { int mid = (l + r) >> 1; if ( __(2)__ ) { r = mid; } else { l = mid + 1; } } return __(3)__; } long long get_rank(int sum) { long long rank = 0; for (int i = 0; i < n; i++) { rank += upper_bound(b, b + n, sum - a[i]) - b; } return rank; } int solve() { int l = 0, r = __(4)__ ; while (l < r) { int mid = ((long long)l + r) >> 1; if ( __(5)__ ) { l = mid + 1; } else { r = mid; } } return l; } int main() { cin >> n >> k; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; cout << solve() << endl; return 0; }