func_code_string: #include <bits/stdc++.h>   using namespace std;   long long cross(pair<long long, long long> a, pair<long long, long long> b,                   pair<long long, long long> c) {     pair<long long, long long> v1 =         make_pair(b.first - a.first, b.second - a.second);     pair<long long, long long> v2 =         make_pair(c.first - a.first, c.second - a.second);     if ((long long)v1.first * (long long)v2.second -             (long long)v2.first * (long long)v1.second >         0)       return 1;     else if ((long long)v1.first * (long long)v2.second -                  (long long)v2.first * (long long)v1.second <              0)       return -1;     return 0;   }   int main(int argc, char* argv[]) {     long long n;     cin >> n;     vector<long long> arr(n);     for (long long i = 0; i < n; i++) {       cin >> arr[i];     }     vector<pair<long long, long long> > p;     p.push_back(make_pair(-1, 0));     long long s = 0;     for (long long i = 0; i < n; i++) {       s += arr[i];       p.push_back(make_pair(i, s));     }     stack<pair<long long, long long> > ch;     ch.push(p[0]);     ch.push(p[1]);     for (long long i = 2; i < n + 1; i++) {       pair<long long, long long> top = ch.top();       ch.pop();       while (ch.size() > 0 && cross(ch.top(), top, p[i]) == -1) {         top = ch.top();         ch.pop();       }       ch.push(top);       ch.push(p[i]);     }     vector<pair<long long, long long> > vec;     while (ch.size()) {       vec.push_back(ch.top());       ch.pop();     }     reverse(vec.begin(), vec.end());     vector<double> cev;     long long cur = 0;     for (long long i = -1; i < n; i++) {       if (vec[cur].first == i)         cev.push_back(vec[cur].second);       else {         if (cur < vec.size() - 1 && vec[cur + 1].first <= i) {           cur++;           i--;           continue;         }         long long x1 = vec[cur + 1].first - vec[cur].first;         long long y1 = vec[cur + 1].second - vec[cur].second;         long long x2 = i - vec[cur].first;         cev.push_back((((double)x2 * (double)y1) / (double)x1) + vec[cur].second);       }     }     for (long long i = 0; i < cev.size() - 1; i++) {       cout << setprecision(13) << double(cev[i + 1] - cev[i]) <<    ;     }     cout << endl;   }   