func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 100005;   long long a[N], sum[N];   long long int gcd(long long int a, long long int b) {     if (a == 0) return b;     return gcd(b % a, a);   }   int main() {     int n;     scanf( %d , &n);     int i;     long long ans = 0;     for (i = 1; i <= n; i++) {       scanf( %I64d , &a[i]);       ans = ans + a[i];     }     sort(a + 1, a + n + 1);     for (i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];     for (i = 1; i <= n; i++) {       int l = 1, r = n;       int idx = -1;       while (l <= r) {         int mid = (l + r) / 2;         if (a[mid] <= a[i]) {           l = mid + 1;           idx = mid;         } else           r = mid - 1;       }       ans = ans + (idx)*1LL * a[i] - sum[idx] + sum[n] - sum[idx] -             (n - idx) * 1LL * a[i];     }     long long g = gcd(ans, 1LL * n);     ans = ans / g;     n = n / g;     printf( %I64d %d n , ans, n);     return 0;   }   