#include using namespace std; #define whole(xs) (xs).begin(),(xs).end() namespace { typedef double real; typedef long long ll; template ostream& operator<<(ostream& os, const vector& vs) { if (vs.empty()) return os << "[]"; os << "[" << vs[0]; for (int i = 1; i < vs.size(); i++) os << " " << vs[i]; return os << "]"; } template istream& operator>>(istream& is, vector& vs) { for (auto it = vs.begin(); it != vs.end(); it++) is >> *it; return is; } int N; vector L; int Q; vector K; void input() { cin >> N; L.resize(N); cin >> L; cin >> Q; K.resize(Q); cin >> K; } struct S { real nlen; int index; S(real nlen, int index) : nlen(nlen), index(index) {} }; bool operator<(const S& a, const S& b) { return a.nlen < b.nlen; } void solve() { vector K2 = K; sort(whole(K2)); vector X(N, 0); ll count = 0; priority_queue PQ; for (int i = 0; i < N; i++) { PQ.push(S(L[i], i)); } vector ans(K2[Q - 1] + 5, -1); while (count <= K2[Q - 1] && not PQ.empty()) { S cur = PQ.top(); PQ.pop(); //cout << cur.index << " " << cur.nlen << endl; int i = cur.index; real next = cur.nlen; X[i]++; ans[++count] = next; PQ.push(S( L[i] / (X[i] + 1), i )); } cout << setprecision(15); for (int i = 0; i < Q; i++) { cout << ans[ K[i] ] << endl; } } } int main() { input(); solve(); return 0; }