#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, err = 0.0; for (int i = 0; i < N; ++i) { fgets(buf, sizeof(buf), stdin); const Int x = atoll(buf); if (x > 0) { /* sqrt(x) - k = (x - k^2) / (sqrt(x) + k) */ const long double y = sqrtl((long double)x); const Int k = (Int)y; const long double z = (x - k * k) / (y + k); upp += k; const long double tmp = low + z; err += z - (tmp - low); low = tmp; } printf("%.17Lg\n", upp + low + err); } return 0; }