#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int n, l, t, tt;
int a[N];
long long ans;
int Find(int x) {
  int head = 0, tail = n + 1, mid;
  while (head + 1 < tail) {
    mid = head + tail >> 1;
    if (a[mid] <= x)
      head = mid;
    else
      tail = mid;
  }
  return head;
}
int main(int argc, const char* argv[]) {
  scanf("%d%d%d", &n, &l, &t);
  t *= 2;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  ans = 0;
  tt = t;
  for (int i = 1; i <= n; i++) {
    t = tt;
    if (t >= l) {
      ans += (long long)(n - 1) * (long long)(t / l);
      t %= l;
    }
    if (a[i] + t < l) {
      ans += (Find(a[i] + t) - i);
    } else {
      ans += (n - i + Find(a[i] + t - l));
    }
  }
  printf("%.10lf\n", ans * 0.25);
  return 0;
}
