#include <bits/stdc++.h>
using namespace std;
const int INF = (-1u) / 2;
const long long int INF2 = (-1ull) / 2;
long long int a, b, i, d[1011000], j, k, n, m, timer = 0, l, r, y, t;
long long int c[1011000], cnt = 0, fl = 0, a2, a3 = -1000000, ans = 0;
long double x, reall, approx[2000301], eror, mean;
long double take(long double a, long double b) {
  if (a > b + 0.0000001)
    return a - b;
  else
    return b - a;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> t >> x;
  mean = 0.0;
  for (i = 1; i <= n; i++) {
    cin >> c[i];
    d[i] = d[i - 1] + c[i];
    mean = (mean + (c[i] * 1.0) / (t * 1.0)) / x;
    approx[i] = mean;
  }
  cin >> m;
  for (i = 1; i <= m; i++) {
    cin >> a;
    reall = (d[a] - d[max(a - t, 0ll)]) * 1.0;
    reall /= (t * 1.0);
    cout << fixed << setprecision(6) << reall << " ";
    cout << fixed << setprecision(6) << approx[a] << " ";
    cout << fixed << setprecision(6) << ((take(approx[a], reall)) / reall)
         << "\n";
  }
  return 0;
}
