#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000000 * 2 + 10;
double Tohka;
int n, l, t, a[MAXN];
void solve() {
  for (int i = 1; i <= n; ++i)
    Tohka += 0.25 * (upper_bound(a + 1, a + n * 2 + 1, a[i] + t) - a - i - 1);
}
int main() {
  scanf("%d%d%d", &n, &l, &t);
  t *= 2;
  Tohka += (double)n * (n - 1) / 2 * 0.5 * ((int)t / l);
  t %= l;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), a[i + n] = a[i] + l;
  solve();
  printf("%.10lf\n", Tohka);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
