#include<bits/stdc++.h>
using namespace std;
long long i,n,s[100003],a=0,g;
int main()
{
cin>>n;
for (i=0;i<n;i++) cin>>s[i];
sort(s,s+n);
for (i=0;i<n;i++) a+=s[i]*(i*4-2*n+3);
g=__gcd(a,n);
cout<<a/g<<" "<<n/g;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKbG9uZyBsb25nIGksbixzWzEwMDAwM10sYT0wLGc7CmludCBtYWluKCkKewogICAgY2luPj5uOwogICAgZm9yIChpPTA7aTxuO2krKykgY2luPj5zW2ldOwogICAgc29ydChzLHMrbik7CiAgICBmb3IgKGk9MDtpPG47aSsrKSAgIGErPXNbaV0qKGkqNC0yKm4rMyk7CiAgICBnPV9fZ2NkKGEsbik7CiAgICBjb3V0PDxhL2c8PCIgIjw8bi9nOwogICAgcmV0dXJuIDA7Cn0=
Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include<bits/stdc++.h>
^
Main.java:3: error: class, interface, or enum expected
long long i,n,s[100003],a=0,g;
^
Main.java:4: error: class, interface, or enum expected
int main()
^
Main.java:7: error: class, interface, or enum expected
for (i=0;i<n;i++) cin>>s[i];
^
Main.java:7: error: class, interface, or enum expected
for (i=0;i<n;i++) cin>>s[i];
^
Main.java:7: error: class, interface, or enum expected
for (i=0;i<n;i++) cin>>s[i];
^
Main.java:8: error: class, interface, or enum expected
sort(s,s+n);
^
Main.java:9: error: class, interface, or enum expected
for (i=0;i<n;i++) a+=s[i]*(i*4-2*n+3);
^
Main.java:9: error: class, interface, or enum expected
for (i=0;i<n;i++) a+=s[i]*(i*4-2*n+3);
^
Main.java:9: error: class, interface, or enum expected
for (i=0;i<n;i++) a+=s[i]*(i*4-2*n+3);
^
Main.java:10: error: class, interface, or enum expected
g=__gcd(a,n);
^
Main.java:11: error: class, interface, or enum expected
cout<<a/g<<" "<<n/g;
^
Main.java:12: error: class, interface, or enum expected
return 0;
^
Main.java:13: error: class, interface, or enum expected
}
^
15 errors