#include <bits/stdc++.h>
using namespace std;
int a[1100000];
int main() {
  long long n, l, t;
  cin >> n >> l >> t;
  t *= 2;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long c = upper_bound(a + i + 1, a + n, (t + a[i]) % l) - a - i - 1;
    ans += (t + l + a[i]) / l * c;
    ans += (t + a[i]) / l * (n - i - 1 - c);
    c = upper_bound(a, a + i, (t + a[i]) % l) - a;
    ans += (t + a[i]) / l * c;
    ans += (t + a[i] - l) / l * (i - c);
  }
  cout << fixed << setprecision(3);
  cout << ans / 4.0 << endl;
  return 0;
}
