#include <bits/stdc++.h>
using namespace std;
int n, l, t;
int a[3000006];
void precompute() {}
void read() {}
int bsearch(int lo, int hi, long long ele) {
  if (ele < a[lo]) return lo - 1;
  int key = hi, lw = lo, hg = hi;
  while (lo <= hi) {
    int mid = lo + hi >> 1;
    if (a[mid] <= ele) {
      key = mid;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  return key;
}
int bsearchB(int lo, int hi, long long ele) {
  if (ele > a[hi]) return hi + 1;
  int key = hi, lw = lo, hg = hi;
  while (lo <= hi) {
    int mid = lo + hi >> 1;
    if (a[mid] < ele) {
      lo = mid + 1;
    } else {
      key = mid;
      hi = mid - 1;
    }
  }
  return key;
}
void solve() {
  scanf("%d%d%d", &n, &l, &t);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    a[n + i] = a[i];
    a[2 * n + i] = a[i];
  }
  long long cy = (2 * t) / l;
  long long tot = 0;
  int inc = (2 * t) % l;
  for (int i = 0; i < n; i++) {
    long long ele = a[i] + inc;
    long long cnt2 = 0, cnt1 = 0;
    if (ele >= l) {
      ele -= l;
      cnt2 = n - i + bsearch(2 * n, 2 * n + n - 1, ele) - 2 * n;
    } else {
      cnt2 = bsearch(2 * n, 2 * n + n - 1, ele) - 2 * n - i;
    }
    ele = a[i] - inc;
    if (ele < 0) {
      ele += l;
      cnt1 = i + n - bsearchB(0, n - 1, ele);
    } else {
      cnt1 = i - bsearchB(0, n - 1, ele);
    }
    tot += cnt1 + cnt2;
    tot += (cy) * (2ll * (n - 1));
  }
  printf("%lf\n", (tot) / 8.0);
}
int main() {
  precompute();
  int t = 1;
  while (t--) {
    read();
    solve();
  }
  return 0;
}
