#include <bits/stdc++.h>
using namespace std;
long long int a[2000006];
int main() {
  long long int n, t, l, i, c, p;
  double ans;
  scanf("%lld%lld%lld", &n, &l, &t);
  c = t / l;
  p = t % l;
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    a[n + i] = a[i] + l;
  }
  ans = c * n * (n - 1) / 2;
  for (i = 0; i < n; i++)
    ans += (upper_bound(a, a + 2 * n, a[i] + 2 * p) - (a + i + 1)) * 0.25;
  printf("%lf\n", ans);
  return 0;
}
