贪心+前缀和
#include<bits/stdc++.h>
using namespace std;
const int N = 100010;
int a[N];
int s[N];
int n;
int main(){
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
sort(a+1,a+n+1);
//前缀和
for(int i=1;i<=n;i++){
s[i]=s[i-1]+a[i];
// cout<<s[i]<<" ";
}
// cout<<endl;
int mid=n/2;
if(n%2==1) cout<<1<<" "<<s[n]-2*s[mid]<<endl;
else cout<<0<<" "<<s[n]-2*s[mid]<<endl;
return 0;
}