import java.util.*;
public class Robot {
    public static void main(String[] args){ 
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    int [] arr = new int[n];
    boolean[] holder = new boolean[5001];
    for (int i = 0; i < n; i++){
        arr[i] = in.nextInt();
    }
    
    ArrayList<Integer> sums = new ArrayList<>();
    for (int i = 0; i< n; i++){
        for (int j = i+1; j< n; j++){
            sums.add(Math.abs(arr[i] - arr[j]));
            holder[Math.abs(arr[i] - arr[j])] = true;
        }
    }
    Collections.sort(sums);
    double wins = 0; double total = (n*n*n*(n-1)*(n-1)*(n-1)/8);
    for (int i = 0; i < sums.size(); i++){
        //System.out.println(sums.get(i));
        for (int j = 0; j < sums.size(); j++){
           // System.out.println(sums.get(j));
        for (int k = sums.get(i)+sums.get(j)+1; k < 5001; k++){
            if (holder[k])
                wins++;
        }
    }}
    
        System.out.println(wins + " "+ total);
        System.out.println(wins/total);
}
}
