CCF--201809-1卖菜
#include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
int arrout[n];
for(int i = 0; i < n; i++){
cin >> arr[i];
}
for(int i = 0; i < n; i++){
if(i == 0 && n > 1){
arrout[i] = (arr[i] + arr[i+1]) / 2;
}else if(i == n-1 ){
arrout[i] = (arr[i] + arr[i-1]) / 2;
}else{
arrout[i] = (arr[i-1] + arr[i] + arr[i+1])/3;
}
}
for(int i = 0; i < n; i++){
cout << arrout[i] << " ";
}
}