#include <bits/stdc++.h>
using namespace std;
long long Max(long long a, long long b) { return a > b ? a : b; }
long long n, l, t, a[2000018];
long long Ans, i, times, mid, ans, j, v, w;
double t0;
int main() {
  scanf("%I64d%I64d%I64d", &n, &l, &t);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) a[n + i] = a[i] + l;
  j = 1;
  t0 = t - (2 * t / l) * (l / 2.0);
  v = (t * 2) % l;
  w = (t * 2) / l;
  for (i = 1; i <= n; i++) {
    while (a[j] - a[i] <= v) j++;
    times = j - i - 1;
    Ans += times;
  }
  printf("%.10lf\n", ((double)Ans + (double)(n - 1) * w * n) * 0.25);
  return 0;
}
