#include #include #include #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; namespace utils{ #define ALL(x) begin(x), end(x) #define RALL(x) rbegin(x), rend(x) ///----- aliases using ll = long long int; using ull = unsigned long long; template using p_queue = priority_queue, Compare>; template using min_queue = p_queue>; template using max_queue = p_queue>; template inline bool CHMIN(T& X, const T& A){ if(X > A) {X = A; return true;} return false; } template inline bool CHMAX(T& X, const T& A){ if(X < A) {X = A; return true;} return false; } ///----- vector I/O template vector VEC(size_t n, T t){ return vector(n, t); } template auto VEC(size_t n, Ts ... ts){ return vector(n, VEC(ts...)); } template istream& operator>>(istream& is, vector& v){ for (auto &&x : v) { is >> x; } return is; } template ostream& operator<<(ostream& os, const vector& v){ auto p = v.begin(); assert(p != v.end()); os << *p++; while(p != v.end()){ os << ' ' << *p++; } return os ; } template ostream& operator<<(ostream& os, const vector>& v){ auto p = v.begin(); assert(p != v.end()); os << *p++; while(p != v.end()){ os << '\n' << *p++; } return os; } ///----- tuple I/O template istream& operator>>(istream& is, tuple& t){ return is >> get<0>(t) >> get<1>(t); } template istream& operator>>(istream& is, pair& t){ return is >> get<0>(t) >> get<1>(t); } template istream& operator>>(istream& is, tuple& t){ return is >> get<0>(t) >> get<1>(t) >> get<2>(t); } template ostream& operator<<(ostream& os, const tuple& t){ return os << get<0>(t) << ' ' << get<1>(t); } template ostream& operator<<(ostream& os, const pair& t){ return os << get<0>(t) << ' ' << get<1>(t); } template ostream& operator<<(ostream& os, const tuple& t){ return os << get<0>(t) << ' ' << get<1>(t) << ' ' << get<2>(t); } ///----- constants constexpr ll INFLL = 1'000'000'000'000'000'020ll; constexpr ll INF = 1'000'000'009; constexpr double PI = 3.14'159'265'358'979'323'846; constexpr double EPS = 1e-12; } using namespace utils; class solver{ istream& is; ostream& os; public: solver(istream& I, ostream& O) :is(I), os(O) {} vector x; bool input() { int N=0; is >> N; x.resize(N); is >> x; return !!is; } void run(); }; void solver::run(){ if(!input()) return; long double a = 0; for (auto &&xi: x) { a += sqrt(xi); os << a << '\n'; } // end xi } int main(int argc, char *argv[]) { cin.tie(nullptr); ios::sync_with_stdio(false); cout << setprecision(17) << scientific; #ifdef XELMH string test_cases = "test_a.txt"; cerr << test_cases << " -->" << endl; auto fs = fstream(test_cases, fstream::in); int loop = 0; while(fs) { loop++; cout << '#' << loop << "#------\n"; solver(fs, cout).run(); } if(loop <= 1) { cout << "===" << endl; while(cin) solver(cin, cout).run(); } #else solver(cin, cout).run(); #endif return 0; }