#include <bits/stdc++.h>
using namespace std;
const int N = 3000004;
int a[N], n;
int main() {
  int len, tm;
  scanf("%d %d %d", &n, &len, &tm);
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i + n] = a[i] + len;
    a[i + n + n] = a[i] + len + len;
  }
  int w = tm / len;
  ans = 2.0 * w * n * (n - 1);
  tm %= len;
  for (int l = 1, r = 1; l <= n; l++) {
    while (a[r] - a[l] <= tm * 2) ++r;
    ans += r - l - 1;
  }
  printf("%.10f\n", ans / 4);
}
