#include <bits/stdc++.h>
using namespace std;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return abs((rand() << 15) ^ rand()); }
inline int rnd(int x) { return myrand() % x; }
const int maxn = (int)1e6 + 10;
int a[maxn];
bool solve() {
  int n, l, t;
  if (scanf("%d%d%d", &n, &l, &t) < 3) return 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  long long ans = 0;
  int r = (2 * t) % l, c = (2 * t) / l;
  for (int i = 0, j = 0; i < n; ++i) {
    while (1) {
      int nj = j + 1;
      if (nj == n) nj = 0;
      if (nj == i) break;
      int d = a[nj] - a[i];
      if (d < 0) d += l;
      if (d <= r)
        j = nj;
      else
        break;
    }
    int cnt = j - i;
    if (cnt < 0) cnt += n;
    ans += cnt;
    if (cnt == 0) j = i + 1;
  }
  printf("%.18lf\n",
         (double)(((long long)(n - 1) * n * (long double)c / 4.0) + ans / 4.0));
  return 1;
}
int main() {
  srand(rdtsc());
  while (1) {
    if (!solve()) break;
  }
  return 0;
}
