#include <cstdio>
#include <algorithm>
#define fin stdin
#define fout stdout
int a[100009];
int main(){
int n;
fscanf(fin, "%d", &n);
for(int i = 1; i <= n; i ++)
fscanf(fin, "%d", &a[i]);
long long ans = 0;
for(int i = 1; i <= n; i ++){
ans += a[i] / 2;
if(i < n && a[i] % 2 && a[i + 1] > 0)
ans ++, a[i + 1] --;
}
fprintf(fout, "%I64d\n", ans);
return 0;
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:23:33: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long long int’ [-Wformat=]
fprintf(fout, "%I64d\n", ans);
^
./Main.cpp:11:26: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fscanf(fin, "%d", &n);
^
./Main.cpp:14:33: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fscanf(fin, "%d", &a[i]);
^