#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool Up(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool Down(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
inline int getus() {
  int tmp, c;
  while (tmp = fgetc(stdin), tmp < '0' || tmp > '9')
    ;
  tmp -= '0';
  while (c = fgetc(stdin), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0';
  return tmp;
}
inline int getint() {
  int tmp, c, flag;
  while (flag = fgetc(stdin), flag != '-' && (flag < '0' || flag > '9'))
    ;
  if (flag == '-')
    tmp = 0;
  else
    tmp = flag - '0';
  while (c = fgetc(stdin), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0';
  return flag == '-' ? -tmp : tmp;
}
int N, L, T, A[2000023];
int con;
long long ans = 0;
int main() {
  scanf("%d %d %d", &N, &L, &T);
  for (int i = (1); i <= (N); ++i) {
    scanf("%d", A + i);
    A[i + N] = A[i] + L;
  }
  T <<= 1;
  con = T / L;
  T %= L;
  int j = 1;
  for (int i = (1); i <= (N); ++i) {
    while (j <= 2 * N && T + A[i] - A[j] >= 0) ++j;
    ans += j - i - 1;
  }
  double s = (double)ans + (double)con * (N - 1) * N;
  printf("%.8f\n", s * 0.25);
  return 0;
}
