#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int pos[3000006];
int main() {
  int n, l, t;
  cin >> n >> l >> t;
  for (int i = 0; i < n; i++) scanf("%d", &pos[i]);
  t *= 2;
  int r = t / l;
  int x = t % l;
  for (int i = 0; i < n; i++) pos[i + n] = pos[i] + l;
  double ans = r * (double)n * (n - 1.0) / 4.0;
  int ptr = 0;
  for (int i = n; i < 2 * n; ++i) {
    while (ptr < i && pos[i] - pos[ptr] > x) ++ptr;
    int length = i - ptr;
    ans += length / 4.0;
  }
  printf("%.10f\n", ans);
  return 0;
}
