#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
long long d[maxn];
int main() {
  int n;
  scanf("%d", &n);
  int a1 = n / 2 + n % 2;
  long long sum = 0;
  for (int i = 1; i <= a1; i++) {
    scanf("%lld", &d[i]);
  }
  long long x;
  scanf("%lld", &x);
  long long now = (long long)(n - a1) * x;
  long long aa = 0;
  int u;
  for (int i = a1; i >= 1; i--) {
    now += d[i];
    if (aa > 0) {
      aa = aa - x + d[i];
    }
    if (aa <= 0) {
      aa = 0;
    }
    if (now > aa) {
      aa = now;
      u = i;
    }
  }
  if (aa)
    printf("%d\n", n - u + 1);
  else
    puts("-1");
  return 0;
}
