#include<stdio.h> intmain(){ int n; scanf("%d",&n); int a1,a2,a3,a4,a5; a1=a2=a3=a4=0; int flag=1; int avg=0; a5=-1; bool cal=false; for (int i = 0; i < n; ++i) { int temp; scanf("%d",&temp); if (temp%5==0&&temp%2==0) { a1+=temp; } if (temp%5==1) { a2+=flag*temp; flag*=-1; cal=true; } if (temp%5==2) { a3++; } if (temp%5==3) { avg+=temp; a4++; } if (temp%5==4) { if (temp>a5) { a5=temp; } }