#include <bits/stdc++.h>
using namespace std;
long long A[2000005];
int main() {
  int n, m, L, T, i, j, k, l;
  double l1, ans = 0, xx, t1;
  scanf("%d%d%d", &n, &L, &T);
  xx = (((long long)2) * T) / L;
  t1 = ((((long long)2) * T) % L) / 2.0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &j);
    A[i] = j;
  }
  sort(A + 1, A + 1 + n);
  for (i = n + 1; i <= n + n; i++) A[i] = A[i - n] + L;
  if (n == 1) {
    printf("0\n");
    n = 2;
    return 0;
  }
  for (j = 2; j <= n; j++)
    if (2 * t1 + (1e-9) < A[j] - A[i]) break;
  j--;
  for (i = 1; i <= n; i++) {
    while (2 * t1 + (1e-9) > A[j] - A[i]) j++;
    j--;
    ans += 0.25 * (xx * (n - 1) + (j - i));
  }
  printf("%.8f\n", ans);
  return 0;
}
