#include <bits/stdc++.h>
using namespace std;
long long int n, t, l;
int a[2 << 20];
int main() {
  cin >> n >> l >> t;
  for (int i = 0; i < n; i++) cin >> a[i];
  t *= 2;
  long long int limit = t % l, laps = t / l, position = 0;
  for (int i = n; i < n * 2; i++) a[i] = a[i - n] + l;
  double ans = laps * (n) * (n - 1);
  for (int i = 0; i < n; i++) {
    while (a[position + 1] - a[i] <= limit) position++;
    ans += (position - i);
  }
  cout << std::fixed << setprecision(10) << (ans * 0.25);
}
