#include <bits/stdc++.h>
using namespace std;
inline int max(int a, int b) { return a < b ? b : a; }
inline int min(int a, int b) { return a > b ? b : a; }
inline long long max(long long a, long long b) { return a < b ? b : a; }
inline long long min(long long a, long long b) { return a > b ? b : a; }
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long INF = 1e18;
int n, h;
long double p;
int arr[N], a1[N], a2[N];
bool u[2005][2005][2][2];
long double dp[2005][2005][2][2];
double calc(int s, int e, int f1, int f2) {
  if (e < s) return 0;
  if (s < 0 || e >= n) return 0;
  if (u[s][e][f1][f2]) return dp[s][e][f1][f2];
  u[s][e][f1][f2] = 1;
  long double &ret = dp[s][e][f1][f2];
  int x1 = arr[a2[s]] - h, x2 = -mod;
  if (s > 0) x2 = arr[s - 1];
  if (s > 0 && f1 == 1) x2 += h;
  int y1 = arr[a1[e]] + h, y2 = mod;
  if (e < n - 1) y2 = arr[e + 1];
  if (f2 == 1) y2 -= h;
  x1 = max(x1, x2);
  y1 = min(y1, y2);
  ret += p * (arr[s] - x1 + calc(s + 1, e, 0, f2)) +
         (1 - p) * (y1 - arr[e] + calc(s, e - 1, f1, 0));
  swap(x2, y2);
  x1 = arr[a1[s]] + h, y1 = arr[a2[e]] - h;
  x1 = min(x1, x2), y1 = max(y1, y2);
  ret += (1 - p) * (x1 - arr[s] + calc(a1[s] + 1, e, 1, f2)) +
         p * (arr[e] - y1 + calc(s, a2[e] - 1, f1, 1));
  ret *= 0.5;
  return ret;
}
int main() {
  double pp;
  scanf("%d%d%lf", &n, &h, &pp);
  p = pp;
  for (int i = 0; i < n; ++i) scanf("%d", &arr[i]);
  sort(arr, arr + n);
  int x = 0;
  while (x < n) {
    int c = x;
    x++;
    while (x < n && arr[x] < arr[x - 1] + h) x++;
    for (int i = c; i < x; ++i) a1[i] = x - 1, a2[i] = c;
  }
  printf("%.9lf\n", (double)calc(0, n - 1, 0, 0));
  return 0;
}
