func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = 1e9 + 7;   const int MXN = 1e6 + 7;   const double EPS = 1e-9;   const double PI = acos(-1);   long long a[MXN], cnt[MXN], n;   long long dp1[MXN], dp2[MXN], pref[MXN];   int main() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i];     }     sort(a + 1, a + n + 1, greater<int>());     for (int i = 1; i <= n; i++) {       for (int j = i + 1; j <= n; j++) {         cnt[a[i] - a[j]]++;       }     }     for (int i = 1; i <= 5500; i++)       for (int j = 1; j <= 5500; j++) dp2[i + j] += cnt[i] * cnt[j];     long double ans = 0;     long long sum = 0;     for (int i = 1; i <= 30000; i++) {       ans += sum * cnt[i];       sum += dp2[i];     }     long long x = (n * (n - 1ll)) / 2;     ans /= x;     ans /= x;     ans /= x;     cout << fixed << setprecision(10) << ans;     return 0;   }   