#include #define show(x) cout << #x << " = " << x << endl using namespace std; using ll = long long; using pii = pair; using vi = vector; template ostream& operator<<(ostream& os, const vector& v) { os << "sz=" << v.size() << "\n["; for (const auto& p : v) { os << p << ","; } os << "]\n"; return os; } template ostream& operator<<(ostream& os, const pair& p) { os << "(" << p.first << "," << p.second << ")"; return os; } constexpr ll MOD = 1e9 + 7; template constexpr T INF = numeric_limits::max() / 100; constexpr ll MAX = 500000; long double table[MAX + 1]; int main() { ll N; cin >> N; using pli = pair; vector L(N); priority_queue q; for (ll i = 0; i < N; i++) { cin >> L[i].first; L[i].second = 1; q.push(L[i]); } for (ll i = 1; i <= MAX; i++) { pli p = q.top(); q.pop(); table[i] = p.first; p.first = p.first * p.second / (p.second + 1); p.second++; q.push(p); } ll Q; cin >> Q; for (ll i = 0; i < Q; i++) { ll K; cin >> K; cout << fixed << setprecision(10) << table[K] << endl; } return 0; }