#include <bits/stdc++.h>
using namespace std;
long long n, l, t, a[3000010], gx;
double Ans;
signed main() {
  scanf("%lld%lld%lld", &n, &l, &t);
  t *= 2;
  gx = t / l, t %= l;
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i + n]);
  for (long long i = 1; i <= n; i++) a[i] = a[i + n] - l;
  for (long long i = 1; i <= n; i++) a[i + n + n] = a[i + n] + l;
  for (long long i = 1, j1 = 1, j2 = i + 1; i <= n; i++) {
    while (a[i + n] - a[j1] > t) j1++;
    while (a[j2 + 1] - a[i + n] <= t && j2 + 1 <= 3 * n) j2++;
    Ans += 0.25 * ((n - 1) * gx + i + n - j1 + (n - 1) * gx + j2 - i - n);
  }
  printf("%.6lf\n", Ans / 2);
}
