数学计算
#include <iostream>
using namespace std;
int n;
int main(void) {
scanf("%d", &n);
int a[n];
for (int i = 0; i < n; ++i)
scanf("%d", &a[i]);
for (int i = 0; i < n; ++i)
printf("%d ", (i == 0)
? (a[i] + a[i + 1] >> 1)
: ((i == n - 1) ? (a[i] + a[i - 1] >> 1) : ((a[i - 1] + a[i] + a[i + 1]) / 3)));
return 0;
}