#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long fast_pow(long long n, long long p) {
  long long res = 1;
  while (p > 0) {
    if (p & 1) res = res * n;
    p = p >> 1;
    n = n * n;
  }
  return res;
}
long long BMod(long long B, long long P, long long M) {
  long long R = 1;
  B = B % M;
  while (P) {
    if (P & 1) R = (R * B) % M;
    P >>= 1;
    B = (B * B) % M;
  }
  return R;
}
long long invMOD(long long num, long long M) { return BMod(num, M - 2, M); }
uint64_t mulmod(uint64_t a, uint64_t b, uint64_t m) {
  if (a > b) swap(a, b);
  uint64_t res = 0;
  uint64_t temp_b;
  if (b >= m) {
    if (m > UINT64_MAX / 2u)
      b -= m;
    else
      b %= m;
  }
  while (a != 0) {
    if (a & 1) {
      if (b >= m - res) res -= m;
      res += b;
    }
    a >>= 1;
    temp_b = b;
    if (b >= m - b) temp_b -= m;
    b += temp_b;
  }
  return res;
}
long long ar[500010];
int main() {
  long long n, x;
  cin >> n;
  long long i = 1;
  while (i <= ceil(n / 2.0)) cin >> ar[i], i++;
  cin >> x;
  while (i <= n) ar[i] = x, i++;
  long long csum[n + 10], csummax[n + 10], cur = 0;
  csum[0] = 0;
  csummax[0] = 0;
  for (typename decay<decltype(n + 1)>::type i = 1; i < n + 1; i++) {
    csum[i] = csum[i - 1] + ar[i];
    cur = csum[i] - i * x;
    csummax[i] = max(cur, csummax[i - 1]);
  }
  for (typename decay<decltype(n + 1)>::type i = ceil(n / 2.0); i < n + 1;
       i++) {
    if (csum[i] > 0 && csummax[n - i] < csum[i]) {
      cout << i;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
