#include using namespace std; using int128 = __int128_t; #define rep(i, n) for (int i = 0; i < n; ++i) #define reps(i, n, s) for (int i = 0; i < n; i += s) #define repl(i, l, r) for (int i = l; i < r; ++i) #define repsl(i, l, r, s) for (int i = l; i < r; i += s) #define all(iterable) (iterable).begin(), (iterable).end() constexpr int dx4[4] = {1, 0, -1, 0}; constexpr int dy4[4] = {0, 1, 0, -1}; constexpr int dx8[8] = {1, 1, 0, -1, -1, -1, 0, 1}; constexpr int dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1}; template void print_vector(const vector& vec, const string sep = " ", const string end = "\n") { int n = vec.size(); rep(i, n) { cout << vec[i]; if (i < n - 1) cout << sep; else cout << end; } } template void read_vector(vector& a, int begin_index, int length) { if (a.size() < begin_index + length) a.resize(begin_index + length); while (length --> 0) cin >> a[begin_index++]; } template void read_vector(vector& a) { read_vector(a, 0, a.size()); } constexpr size_t M = 500010; int main() { size_t n; cin >> n; vector l(n), t(n, 0); read_vector(l, 0, n); auto cmp = [&](size_t x, size_t y) { long double xd = (long double) l[x] / (t[x] + 1); long double yd = (long double) l[y] / (t[y] + 1); return xd < yd; }; priority_queue, decltype(cmp)> pq {cmp}; rep(j, n) pq.push(j); vector ans(M); repl(i, 1, M) { size_t j = pq.top(); pq.pop(); ans[i] = (long double) l[j] / ++t[j]; pq.push(j); } size_t q; cin >> q; cout << fixed << setprecision(20); while (q --> 0) { size_t k; cin >> k; cout << ans[k] << '\n'; } return 0; }