#include <bits/stdc++.h>
using namespace std;
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(long long &x, long long y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(long long &x, long long y) { return (y > x) ? x = y, 1 : 0; }
const int N = 300000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const int MOD2 = 998244353;
const long double eps = 1e-12;
const double pi = atan2(0, -1);
const int ABC = 26;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  int n, l, t;
  cin >> n >> l >> t;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += 4LL * (n - 1) * (t / l);
    int T = (t % l) * 2;
    if (T >= l) {
      ans += 2 * (n - 1);
      T -= l;
    }
    if (a[i] - T >= 0) {
      ans += i - (lower_bound(a, a + i, a[i] - T) - a);
    } else {
      ans += i + (n - (lower_bound(a + i + 1, a + n, l - (T - a[i])) - a));
    }
    if (a[i] + T < l) {
      ans += (upper_bound(a + i + 1, a + n, a[i] + T) - a - 1) - i;
    } else {
      ans += (n - i - 1) + (upper_bound(a, a + i, T - (l - a[i])) - a);
    }
  }
  cout << (long double)ans / 8 << "\n";
  return 0;
}
