#include <bits/stdc++.h>
using namespace std;
int A[2 << 20];
int main() {
  int n, l, t;
  scanf("%d%d%d", &n, &l, &t);
  t += t;
  int i;
  for (i = (0); i < (n); ++i) scanf("%d", &A[i]);
  sort(A, A + n);
  for (i = (0); i < (n); ++i) A[n + i] = A[i] + l;
  long long res = 0;
  int pos = 0;
  int limit = t % l;
  long long a = t / l;
  for (i = (0); i < (n); ++i) {
    while (A[pos + 1] - A[i] <= limit) ++pos;
    res += (pos - i) * (a + 1);
    res += (n - 1 - (pos - i)) * a;
  }
  printf("%.7lf\n", (res + 0.0) / 4);
  return 0;
}
