#include <bits/stdc++.h>
using namespace std;
long long a[1000000];
int main() {
  long long n, l, t, r, i, x, y;
  double ret;
  scanf("%I64d %I64d %I64d", &n, &l, &t);
  for (i = 0; i < n; i++) scanf("%I64d", a + i);
  r = t % l;
  ret = 0.5 * n * (n - 1) * (t / l);
  for (i = 0; i < n; i++) {
    x = upper_bound(a + i + 1, a + n, a[i] + 2 * r) - a;
    y = lower_bound(a, a + i, a[i] - 2 * r) - a;
    ret += 0.125 * (x - y - 1);
    x = upper_bound(a + i + 1, a + n, a[i] + 2 * r - l) - a;
    y = lower_bound(a, a + i, a[i] - 2 * r + l) - a;
    ret += 0.125 * (x - y - 1);
    x = lower_bound(a + i + 1, a + n, a[i] + l - 2 * r) - a;
    y = upper_bound(a, a + i, a[i] - l + 2 * r) - a;
    ret += 0.125 * (n - x + y);
    x = lower_bound(a + i + 1, a + n, a[i] + 2 * l - 2 * r) - a;
    y = upper_bound(a, a + i, a[i] - 2 * l + 2 * r) - a;
    ret += 0.125 * (n - x + y);
  }
  printf("%.10lf", ret);
  return 0;
}
