#include <bits/stdc++.h>
using namespace std;
int a[2 * 1000111];
int main() {
  int n, l, t;
  cin >> n >> l >> t;
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = n; i < 2 * n; i++) a[i] = l + a[i - n];
  double ans = 0;
  t = t * 2;
  int step = t / l;
  t = t % l;
  for (int i = 0; i < n; i++) {
    int pos = upper_bound(a + i, a + i + n, a[i] + t) - a;
    pos--;
    ans += 1.0 * (pos - i);
    ans += step * (n - 1);
  }
  printf("%.10lf\n", ans / 4);
  return 0;
}
