#include <bits/stdc++.h>
using namespace std;
int a[2000005];
int n, l, t;
int main() {
  while (cin >> n >> l >> t) {
    for (int(i) = (0); (i) < (n); (i)++) {
      scanf("%d", &a[i]);
      a[n + i] = l + a[i];
    }
    int div = t / l;
    double res = (long long)2 * n * (n - 1) * div;
    int j = 0;
    t %= l;
    for (int(i) = (0); (i) < (n); (i)++) {
      for (; j < 2 * n && a[j] - a[i] <= 2 * t; j++)
        ;
      res += (j - i - 1);
    }
    printf("%.10lf\n", 0.25 * res);
  }
  return 0;
}
