#include <bits/stdc++.h>
using std::bitset;
using namespace std;
int bins(int x, int *a, int l, int r) {
  while (l < r) {
    int mid = (l + r) / 2;
    if (a[mid] > x) {
      r = mid - 1;
    } else if (a[mid] < x) {
      l = mid + 1;
    } else {
      r = l = mid;
    }
  }
  return l;
}
int number[2002000] = {0};
int main() {
  int n, l, t;
  scanf("%d%d%d", &n, &l, &t);
  for (int i = 0; i < n; i++) {
    scanf("%d", &number[i]);
  }
  if (n == 1) {
    printf("0\n");
  } else {
    long long ss = 2 * (long long)t / l;
    long long sp = 2 * (long long)t % l;
    double q = (double)ss * n * (n - 1) / 4.0;
    for (int i = 0; i < n; i++) {
      int w = (number[i] + sp) % l;
      int p = bins(w, number, 0, n - 1);
      int state = 1;
      if (w >= number[p]) {
        state = 0;
      }
      q = q + (p - i - state + n) % n / 8.0;
      w = (number[i] - sp + l) % l;
      p = bins(w, number, 0, n - 1);
      state = 0;
      if (w > number[p]) {
        state = 1;
      }
      q = q + (i + n - p - state) % n / 8.0;
    }
    printf("%.10lf\n", q);
  }
  return 0;
}
