#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using Int = long long; template ostream &operator<<(ostream &os, const pair &a) { return os << "(" << a.first << ", " << a.second << ")"; }; template void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; } template bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; } template bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; } int main() { char buf[110]; fgets(buf, sizeof(buf), stdin); const int N = atoi(buf); Int upp = 0; long double low = 0.0; for (int i = 0; i < N; ++i) { fgets(buf, sizeof(buf), stdin); const Int x = atoll(buf); if (x > 0) { /* t = sqrt(x) - k f(t) = (t + k)^2 - x f'(t) = 2 (t + k) t <- t - ((t + k)^2 - x) / (2 (t + k)) = (t^2 + x - k^2) / (2 (t + k)) */ const long double y = sqrtl((long double)x); const Int k = (Int)y; long double t = k; t = (t * t + (x - k * k)) / (2.0L * (t + k)); t = (t * t + (x - k * k)) / (2.0L * (t + k)); t = (t * t + (x - k * k)) / (2.0L * (t + k)); t = (t * t + (x - k * k)) / (2.0L * (t + k)); t = (t * t + (x - k * k)) / (2.0L * (t + k)); t = (t * t + (x - k * k)) / (2.0L * (t + k)); t = (t * t + (x - k * k)) / (2.0L * (t + k)); t = (t * t + (x - k * k)) / (2.0L * (t + k)); // cerr<