#include #include #include #include #include #include #include #include #include using namespace std; int main() { int n , k; cin >> n >> k; k--; vector x(n); for (int i = 0; i < n; i++) { cin >> x[i]; } vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } int i = k , j = k; int ans = 0; long long mx = -1e18; long long mn = 1e18; int t = n; while (t--) { mx = max(mx , x[i] + a[i]); if (i < n - 1 && x[i + 1] <= mx) { i++; mn = min(mn , x[i] - a[i]); } mn = min(mn , x[j] - a[j]); if (j >= 1 && x[j - 1] >= mn) { j--; mx = max(mx , x[j] + a[j]); } } cout << i << " " << j << endl; cout << i - j + 1 << endl; return 0; }