#include <bits/stdc++.h>
int a[10000009];
int main() {
  int n, l, t;
  while (scanf("%d %d %d", &n, &l, &t) == 3) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      a[i + n] = a[i] + l;
    }
    int k = t / l;
    int p = t % l;
    double ans = (double)2 * k * n * (n - 1);
    for (int i = 0, j = 0; i < n; i++) {
      while (j < 2 * n && a[j] - a[i] <= 2 * p) j++;
      ans += j - i - 1;
    }
    printf("%.10f\n", ans / 4);
  }
}
