func_code_string: #include <bits/stdc++.h>   const int maxn = 5e5 + 5;   using namespace std;   int a[maxn];   int main() {     int n;     scanf( %d , &n);     long long ans = 0, sum = 0;     for (int i = 1; i <= n; ++i) {       scanf( %d , &a[i]);       int del = min((long long)a[i] >> 1, sum);       ans += del;       sum -= del;       a[i] -= del << 1;       ans += a[i] / 3;       a[i] %= 3;       sum += a[i];     }     cout << ans << endl;     return 0;   }   