#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll _mergeSort(ll arr[], ll temp[], 
				ll left, ll right); 
ll merge(ll arr[], ll temp[], ll left, 
				ll mid, ll right); 

ll mergeSort(ll arr[], ll array_size) 
{ 
	ll temp[array_size]; 
	return _mergeSort(arr, temp, 0, array_size - 1); 
} 

/* An auxiliary recursive function 
that sorts the input array and 
returns the number of inversions in the array. */
ll _mergeSort(ll arr[], ll temp[], 
				ll left, ll right) 
{ 
	ll mid, inv_count = 0; 
	if (right > left) { 
		/* Divide the array into two parts and 
		call _mergeSortAndCountInv() 
		for each of the parts */
		mid = (right + left) / 2; 

		/* Inversion count will be sum of 
		inversions in left-part, right-part 
		and number of inversions in merging */
		inv_count += _mergeSort(arr, temp, 
								left, mid); 
		inv_count += _mergeSort(arr, temp, 
							mid + 1, right); 

		/*Merge the two parts*/
		inv_count += merge(arr, temp, left, 
						mid + 1, right); 
	} 
	return inv_count; 
} 

/* This funt merges two sorted arrays 
and returns inversion count in the arrays.*/
ll merge(ll arr[], ll temp[], ll left, 
		ll mid, ll right) 
{ 
	ll i, j, k; 
	ll inv_count = 0; 

	i = left; /* i is index for left subarray*/
	j = mid; /* j is index for right subarray*/
	k = left; /* k is index for resultant merged subarray*/
	while ((i <= mid - 1) && (j <= right)) { 
		if (arr[i] <= arr[j]) { 
			temp[k++] = arr[i++]; 
		} 
		else { 
			temp[k++] = arr[j++]; 

			/* this is tricky -- see above 
			explanation/diagram for merge()*/
			inv_count = inv_count + (mid - i); 
		} 
	} 

	/* Copy the remaining elements of left subarray 
(if there are any) to temp*/
	while (i <= mid - 1) 
		temp[k++] = arr[i++]; 

	/* Copy the remaining elements of right subarray 
(if there are any) to temp*/
	while (j <= right) 
		temp[k++] = arr[j++]; 

	/*Copy back the merged elements to original array*/
	for (i = left; i <= right; i++) 
		arr[i] = temp[i]; 

	return inv_count; 
} 

int main() 
{ 
	ll n;
	cin>>n;
	ll a[n],b[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		b[i]=a[i];
	}
	
	ll ans = mergeSort(b, n); 
	cout<<ans<<endl;
	for(int i=0;i<n-1;i++)
	{
		cout<<ans-a[i]+(n-a[i]-1)<<endl;
		ans=ans-a[i]+(n-a[i]-1);
	}
	return 0; 
} 



/**
 *    author:  upsolver69
**/
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0);
#define f_in(file) freopen(file, "r", stdin)
#define f_out(file) freopen(file, "w", stdout)
#define sz(a) int((a).size())
#define pp pair
#define fi first
#define vt vector
#define se second
#define vt vector
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(c) c.begin(), c.end()
#define tr(i, c) for(auto& i : c)
#define present(c,x) (c.find(x) != c.end())  // Set and Maps
#define cpresent(c,x) (find(allc,x) != c.end()) // Vectors

using namespace std;

typedef long long ll;

const int mod = 1e9 + 7;
const int inf = (int) 1e9;

using pd = pair<double, double>;

void testcase() {
  int n, m, k;
  cin >> n >> m >> k;
  vt<bool> a(n + 1, 0);
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    a[x] = 1;
  }
  vector<pd> dp(n + m + 1, mp(0.0, 0.0));
  pd sum = {0, 0};
  for (int i = n - 1; i >= 0; i--) {
    sum.fi += dp[i + 1].fi;
    sum.se += dp[i + 1].se;
    sum.fi -= dp[i + m + 1].fi;
    sum.se -= dp[i + m + 1].se;
    if (a[i]) {
      dp[i] = mp(0, 1);
    } else {
      dp[i] = mp(1 + sum.fi / (double) m, sum.se / (double) m);
    }
  }
  double p = dp[0].fi;
  double q = 1 - dp[0].se;
  if (abs(q) < 1e-10) {
    cout << -1;
  } else {
    cout << fixed << setprecision(10) << p / q;
  }
}

int main(void) {
  fast
  int tt = 1;
  // cin >> tt;
  while (tt--) {
    testcase();
  }
  return 0;
}
