#include<bits/stdc++.h>
#define ll long long int
#define pll pair<ll,ll>
#define vpll vector< pll >
#define mpll map<ll,ll>
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define s(v) v.size()
#define test ll t;cin>>t;while(t--)
#define vec vector<ll>
#define read0(v,n) for(int i=0;i<n;i++)cin>>v[i];
#define read1(v,n) for(int i=1;i<=n;i++)cin>>v[i];
#define trav(a,x) for (auto& a: x)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define cut(x) {cout<<x;return 0;}
#define print(x) {cout<<x<<nl;continue;}
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORB(i,a,b) for(int i=a;i>=b;i--)
#define err1(a) {cout<<#a<<' '<<a<<nl;}
#define err2(a,b) {cout<<#a<<' '<<a<<' '<<#b<<' '<<b<<nl;}
#define mem(a,b) memset(a,b,sizeof(a))

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define nl '\n'
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
#define oset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
ll gcd(ll a, ll b){
	if (b==0)return a;
	return gcd(b, a % b);
}
ll lcm(ll a,ll b){

    return (a*b)/gcd(a,b);
}
ll bpow(ll a, ll b){
	ll ans=1;
	while(b){
		if(b&1)
			ans=(ans*a)%MOD;
		b/=2;
		a=(a*a)%MOD;
	}
	return ans;
}
bool subset[102][100005];
ll v[105];
void precompute(int n,int sum){
	 // If sum is 0, then answer is true
    for (int i = 0; i <= n; i++)
        subset[i][0] = true;
 
    // If sum is not 0 and set is empty,
    // then answer is false
    for (int i = 1; i <= sum; i++)
        subset[0][i] = false;
 
    // Fill the subset table in botton up manner
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= sum; j++) {
            if (j < v[i - 1])
                subset[i][j] = subset[i - 1][j];
            if (j >= v[i - 1])
                subset[i][j] = subset[i - 1][j]
                               || subset[i - 1][j - v[i - 1]];
        }
    }
}
 
int main(){

	#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	#endif
    fast
    int n;
    cin>>n;
    FOR(i,0,n-1)cin>>v[i];
    precompute(n,n*1000+2);
    ll sum=0;
    FOR(i,0,n-1)sum+=v[i];
    ll ans=1e9;
    FOR(j,0,sum){
    	if(subset[n][j]){
    		ans=min(ans,max(sum-j,(ll)j));
    	}		
    }
    cut(ans)

       
}
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

int main(){
double N,x[100010],a,U;
long long M;
int i;
cin >> N;
a=0;
M=0;
U=0;
for(i=1;i<=N;i++){
cin >> x[i];
if(x[i]<0){x[i]=-1*x[i];}
if(x[i]>a){a=x[i];}
}

for(i=1;i<=N;i++){M=M+x[i];
U=U+x[i]*x[i];}

cout << M << endl;
cout << setprecision(30) << sqrt(U) << endl;
cout << a << endl;




return 0;
}