#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int main() {
  long long n, l, t;
  cin >> n >> l >> t;
  long long round = t / l;
  t = t % l;
  long long cntR = 0;
  cntR = 1LL * (n - 1) * (n)*2 * round;
  double sp = 0;
  long long eqCnt = 0;
  for (int i = 0; i < n; i++) {
    long long k;
    cin >> k;
    v.push_back(k);
  }
  int N = n;
  for (int i = 0; i < n; i++) {
    int s = i, e = N - 1;
    int ml = s;
    while (s <= e) {
      int m = (s + e) / 2;
      if (v[m] - v[i] <= 2 * t) {
        s = m + 1;
        ml = m;
      } else {
        e = m - 1;
      }
    }
    v.push_back(v[i] + l);
    cntR += (ml - i);
    N++;
  }
  cout << cntR / 4 << "." << (cntR % 4) * 25 << endl;
}
