#include #include #include #include #include #include #include #include #include using namespace std; typedef signed long long ll; int pred(pair first, pair second) { return first.second < second.second; } int main() { ll n; cin >> n; vector bars(n); priority_queue> queue; for(int i = 0; i < n;i++) { cin >> bars[i]; queue.push(make_pair(bars[i], i)); } int q; cin >> q; vector queries(q); for(int i = 0; i < q;i++) { cin >> queries[i]; } const int maxValue = 500001; vector taken(maxValue); vector longest(maxValue); memset(&taken.front(), 0, sizeof(int)*maxValue); for(int i = 1; i < maxValue;i++) { double length = queue.top().first; longest[i] = length; int index = queue.top().second; queue.pop(); taken[index]++; queue.push(make_pair((double)bars[index] / (taken[index] + 1), index)); } for(int m = 0;m < q;m++) { printf("%.15f\n", longest[queries[m]]); } }