#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int MAXN = 1000002;
int n, l, t;
int a[MAXN << 1];
inline void init() {
  scanf("%d%d%d", &n, &l, &t);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  sort(a, a + n);
}
int main() {
  init();
  t <<= 1;
  double res = 0.0;
  int cycles = t / l;
  t %= l;
  res += (double)cycles * (double)n * (double)(n - 1) * 0.5;
  for (int i = 0; i < n; ++i) a[i + n] = a[i] + l;
  for (int i = 0; i < n; ++i) {
    int ind = i + n;
    int l = 1, r = n - 1;
    int cur = 0;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (a[ind] - a[ind - mid] <= t) {
        cur = mid;
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    res += (double)cur * 0.25;
    cur = 0;
    l = 1, r = n - 1;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (a[i + mid] - a[i] <= t) {
        cur = mid;
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    res += (double)cur * 0.25;
  }
  res /= 2.0;
  printf("%.15lf\n", res);
  return 0;
}
