Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: nongkun4444

Problemset: KhaPhisadan

Language: cpp

Time: 0.004 second

Submitted On: 2025-12-28 20:40:23

/******************************************************************************

Welcome to GDB Online.
  GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, 
  C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS
  Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin>>N;
    int x;
    float a = 0;
    int min = 1000,max = 0;
    for(int i=0;i<N;i++){
        cin>> x;
        a += x;
        if(x > max) max = x;
        if(x < min) min = x;
    }
    float m = a/N;
    float v = min + max + m;
    cout<<ceil(v)<<'\n';
    
    
}