/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.IOException;
import java.util.*;
import java.math.*;
/**
 *
 * @author saurav
 */

public class Main {

    /**
     * @param args the command line arguments
     */
    
  
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
         Scanner sc =new Scanner (System.in);
        long n=sc.nextLong(); 
        long diff[]= new long [10010];
        long diff2[]=new long[10010];
        final int k=(int) (n);
        long a[]=new long[k];
        
      //  long g;
        for(int i=0; i<n; i++){
             a[i]=sc.nextLong();
               
        }   
      //  System.out.println("done\n");
        Arrays.sort(a);
        //reverse(a,a+n);
        //vi r1;

        //memset(diff,0,sizeof diff);
        for(int i=0; i<n; i++)
        {

            for(int j=i+1; j<n; j++)
            {
                //   r1.eb(a[j]-a[i]);
                diff[(int)a[j]-(int)a[i]]++;

            }


        }


        // memset(diff2,0,sizeof diff2);

        for(int i=10000; i>=0; i--)
        {
            diff2[i]=diff[i+1]+diff2[i+1];


        }
         double ans=0.0;

        for(int i=1; i<=5000; i++)
            for(int j=1; j<=5000; j++)
                ans+=diff[i]*diff[j]*diff2[i+j];





        double temp=n*(n-1.0)/2.0;


        ans/=temp;
        ans/=temp;
        ans/=temp;
        System.out.printf("%.16f\n",ans);


    
       
       
     
    }
         
    
    }
    


