import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.math; // math functions const real mi = 1e-6; const real eps = 1e-10; void main() { auto n = readln.chomp.to!size_t; auto li = readln.split.to!(real[]); auto q = readln.chomp.to!size_t; auto ki = readln.split.to!(size_t[]); struct LN { real l; size_t n; } size_t[real] buf; auto calc(real m) { if (m in buf) return LN(m, buf[m]); auto n = size_t(0); foreach (l; li) n += (l / m).floor.to!size_t; buf[m] = n; return LN(m, n); } auto rng = iota(mi, li[0] + eps, eps).retro.map!(a => calc(a)).assumeSorted!"a.n < b.n"; foreach (k; ki) { auto r = rng.upperBound(LN(0, k - 1)); writefln("%.10f", r.front.l); } }