You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
389 B
19 lines
389 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
const int N = 1010;
|
|
int a[N];
|
|
int main() {
|
|
int n;
|
|
scanf("%d", &n);
|
|
for (int i = 0; i < n; i++) scanf("%d", &a[i]);
|
|
|
|
printf("%d ", (a[0] + a[1]) / 2);
|
|
|
|
for (int i = 1; i < n - 1; i++)
|
|
printf("%d ", (a[i - 1] + a[i] + a[i + 1]) / 3);
|
|
|
|
printf("%d\n", (a[n - 2] + a[n - 1]) / 2);
|
|
return 0;
|
|
}
|