Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Veerawich

Problemset: KhaPhisadan

Language: cpp

Time: 0.004 second

Submitted On: 2025-12-28 20:36:57

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

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

*******************************************************************************/
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a;
    cin>>a;
    int b=0;
    float c=0;
    int minn = INT_MAX;
    int maxx = INT_MIN;
    int d=0;
    for(int i=0;i<a;i++) {
        cin>>b;
        if(minn > b) {
            minn = b;
        }
        if(maxx < b) {
            maxx = b;
        }
        c += b;
    }
    int h = ceil(minn + maxx + (c/a));
    cout<<h;
}