#include #include using namespace std; using namespace atcoder; using ll = long long; constexpr ll mod = 1e9 + 7; constexpr ll INF = 1LL << 60; #define REP(i, init, n) for(int i = (int)(init); i < (int)(n); i++) #define RREP(i, init, n) for(int i = (int)(init); i >= (int)(n); i--) #define All(A) A.begin(), A.end() #define rAll(A) A.rbegin(), A.rend() #define vi vector #define vl vector #define vvi vector> #define vvl vector> #define pint pair #define plong pair int N, Q; vl L, K; void solve() { priority_queue> que; vi div(N, 1); REP(i, 0, N) { que.push({(long double)L[i], i}); } vector ans(500001); REP(i, 1, 500001) { auto [l, idx] = que.top(); que.pop(); ans[i] = l; div[idx]++; que.push({(long double)L[idx] / div[idx], idx}); } REP(i, 0, Q) { cout << fixed << setprecision(20) << ans[K[i]] << endl; } } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cin >> N; L.resize(N); REP(i, 0, N) { cin >> L[i]; } cin >> Q; K.resize(Q); REP(i, 0, Q) { cin >> K[i]; } solve(); }