#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 1000 + 100;
int n, l, t;
int h;
long long a[3 * maxn];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> l >> t;
  h = t / l, t %= l;
  for (int i = 0, _n = (int)(n); i < _n; i++)
    cin >> a[i], a[n + i] = l + a[i], a[n + n + i] = l + l + a[i];
  long long sum = 0;
  for (int i = 0, _n = (int)(n); i < _n; i++) {
    int pos;
    pos = upper_bound(a, a + 3 * n, a[i] + 2 * t) - a;
    int cnt1 = pos - i - 1;
    if (pos > n + i) cnt1--;
    pos = lower_bound(a, a + 3 * n, a[i] + l + l - 2 * t) - a;
    int cnt2 = n + n + i - pos;
    if (pos <= n + i) cnt2--;
    sum += cnt1 + cnt2;
  }
  cout << fixed << setprecision(8)
       << (sum / 4.0 + h * (long long)n * (long long)(n - 1)) / 2.0 << endl;
  {
    int _;
    cin >> _;
    return 0;
  }
}
