#include <bits/stdc++.h>
int a[2000010];
int main() {
  int n, l, t;
  int i, j, k;
  scanf("%d%d%d", &n, &l, &t);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i + n] = l + a[i];
  }
  double cnt = 0;
  j = 0;
  t *= 2;
  int x = t / l;
  t %= l;
  for (i = 0; i < n; i++) {
    for (; j < 2 * n && a[j] - a[i] <= t; j++)
      ;
    cnt += j - i - 1;
  }
  printf("%.8lf\n", (double(x) * double(n) * (n - 1.0) + cnt) * 0.25);
  return 0;
}
