#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000000;
int n, l, t;
int v[MAX_N + 1];
double sol;
void read() {
  ios_base::sync_with_stdio(false);
  cin >> n >> l >> t;
  for (int i = 0; i < n; ++i) cin >> v[i];
}
int dist(int i, int j) {
  if (j > i) return v[j] - v[i];
  return v[j] + l - v[i];
}
void solve() {
  sol = (static_cast<double>(n) * (n - 1) / 2) * (t / l);
  t %= l;
  sort(v, v + n);
  for (int i = 0; i < n; ++i) {
    int left = 0, right = n - 1;
    while (left != right) {
      int mid = (left + right + 1) / 2;
      int pos = (i + mid) % n;
      if (l + dist(i, pos) <= 2 * t)
        left = mid;
      else
        right = mid - 1;
    }
    sol += static_cast<double>(left) / 2;
    int left2 = 0, right2 = n - 1;
    while (left2 != right2) {
      int mid = (left2 + right2 + 1) / 2;
      int pos = (i + mid) % n;
      if (dist(i, pos) <= 2 * t)
        left2 = mid;
      else
        right2 = mid - 1;
    }
    sol += static_cast<double>(left2 - left) / 4;
  }
  cout << setprecision(9) << fixed;
  cout << sol << "\n";
}
int main() {
  read();
  solve();
}
