#include #include #include #include #include using namespace std; using pii = pair; #include int main() { cout << fixed << setprecision(12); const int MAX = 5e5; int n; cin >> n; vector l(n); for (int &li: l) cin >> li; vector memo(MAX + 1); auto c = [](pii a, pii b) { return a.first * b.second < b.first * a.second; }; priority_queue, decltype(c)> pq(c); for (int li: l) pq.emplace(li, 1); for (int i = 1; i <= MAX; i++) { int p, q; tie(p, q) = pq.top(); pq.pop(); memo[i] = 1.0 * p / q; pq.emplace(p, q + 1); } int q; cin >> q; while (q--) { int k; cin >> k; cout << memo[k] << endl; } return 0; }