#include #include #define FORR(i,b,e) for(int i=(b);i<(int)(e);++i) #define FOR(i,e) FORR(i,0,e) #define dump(var) cerr << #var ": " << var << "\n" #define dumpc(con) for(auto& e: con) cerr << e << " "; cerr<<"\n" typedef long long ll; typedef unsigned long long ull; using namespace std; int L[100010], K[100010]; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, Q; double lsum = 0; cin >> N; FOR(i, N) { cin >> L[i]; lsum += L[i]; } cin >> Q; FOR(i, Q) { cin >> K[i]; } cout << fixed << setprecision(10); FOR(q, Q) { double l = 0.0, u = lsum/K[q], m, d; FOR(i, 50) { // (u-l < EPS) m = (l+u)/2; d = 1 / m; ll cnt = 0; FOR(j, N) { cnt += (ll)(L[j]*d); } if (cnt < K[q]) { u = m; } else { l = m; } } cout << m << "\n"; } return 0; }