#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int compare(const void *a,const void *b) {
    return *(const int *)a-*(const int *)b;
}

int main() {
    int t;
    int num[300001];
    scanf("%d",&t);
    if (t==0){
        printf("0");
        return 0;
    }
    for(int i=0;i<t;i++) {
        scanf("%d",&num[i]);
    }
    qsort(num,t,sizeof(int),compare);
    
    int cut=(int)round(t*0.15);
    float sum=0;
    for(int i=cut; i<t-cut; i++) {
        sum+=num[i];
    }
    
    printf("%d",(int)round(sum/(t-2*cut)));
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: