func_code_string: #include <bits/stdc++.h>   using namespace std;   void qmax(long long &x, long long y) {     if (x < y) x = y;   }   void qmin(long long &x, long long y) {     if (x > y) x = y;   }   inline long long read() {     char s;     long long k = 0, base = 1;     while ((s = getchar()) !=  -  && s != EOF && !(isdigit(s)))       ;     if (s == EOF) exit(0);     if (s ==  - ) base = -1, s = getchar();     while (isdigit(s)) {       k = k * 10 + (s ^  0 );       s = getchar();     }     return k * base;   }   inline void write(long long x) {     static char cnt, num[15];     cnt = 0;     if (!x) {       putchar( 0 );       return;     }     for (; x; x /= 10) num[++cnt] = x % 10;     for (; cnt; putchar(num[cnt--] + 48))       ;   }   const long long maxn = 100000 + 100;   long long n, d, b, d1;   long long a[maxn];   long long s1[maxn], s2[maxn];   signed main() {     n = read();     d = read();     b = read();     d1 = n / 2 * b;     for (long long i = 1; i <= n; i++) a[i] = read();     for (long long i = 1; i <= n; i++) {       s1[i] = min(a[i], d1) + s1[i - 1];       d1 -= min(d1, a[i]);     }     d1 = n / 2 * b;     for (long long i = n; i >= 1; i--) {       s2[i] = min(a[i], d1) + s2[i + 1];       d1 -= min(d1, a[i]);     }     d1 = 0;     long long R = n / 2, r = 0, ans1 = 0, ans2 = 0;     for (long long i = 1; i <= R; i++) {       r += d + 1;       r = min(n, r);       if (d1 + b <= s1[r])         d1 += b;       else         ans1++;     }     R = (n + 1) / 2 + 1;     d1 = 0;     r = 0;     long long l = n + 1;     for (long long i = n; i >= R; i--) {       l -= d + 1;       l = max(1ll, l);       if (d1 + b <= s2[l])         d1 += b;       else         ans2++;     }     cout << max(ans1, ans2);     return 0;   }   