import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;


public class VentureD {

	public static void main(String[] args) throws NumberFormatException, IOException {
		Scanner sc = new Scanner();
		int n = sc.nextInt();
		int a[] = new int[n];

		for(int i=0; i<n; i++)
			a[i] = sc.nextInt();

		Arrays.sort(a);

		
		int count = 0;
		double result = 0;
		for(int k = n-1; k>=1; k--){
			int sA = a[k];
			int sB = a[0];
			int low = 1;
			int high = k;
			int ans = -1;
			while(low<= high){
				int mid = (low+high)/2;
				if(sB + 2*a[mid] < sA + 2*a[mid-1]){
					ans = mid;
					low = mid+1;
				}
				else
					high = mid-1;
			}
			
			if(ans == -1){
				break;
			}
			
			
			int lastI = ans-1;
			
			
			
			
			//-------------
			boolean tm = false;
			double res = 0;
			for(int j = ans; j>=1; j--){
				boolean br = false;
				//			for(int i = lastI; i>=0; i--){
				//				if(sB + 2*a[j] >= sA + 2*a[i]){
				//					int diff = j-i;
				//					count += diff*(diff-1)/2;
				//					br = true;
				//					lastI = i-1;
				//					break;
				//				}
				//			}
				int ans2 = -1;
				low = 0; high = lastI;
				while(low<=high){
					int mid = (low+high)/2;
					if(sB + 2*a[j] >= sA + 2*a[mid]){
						ans2 = mid;
						high = mid-1;
					}
					else
						low = mid+1;
				}
				if(ans2 == -1){
					count += j*(j+1)/2;
					res += (j*(j+1)/2)*1.0/n * 2.0/((double)n*n);;
					break;
				}
				else{
					count += (j-ans2)*(j-ans2-1)/2;
					res += ((j-ans2)*(j-ans2-1)/2)*1.0/n * 1.0/(n*n);
					tm = true;
					lastI = ans2-1;
				}
			}
			if(tm)
				res *= 1.0/n;
			result += res;
		}
//		System.out.println(count);
//		double res = 1.0*count/(n*(n-1)*3);
		System.out.println(result);


	}

	static class Scanner{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;


		String next() throws IOException
		{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		int nextInt() throws NumberFormatException, IOException{
			return Integer.parseInt(next());
		}
	}

}
