#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>

using lint = long long;
using ldouble = long double;

void solve() {
    int n;
    std::cin >> n;

    std::vector<std::pair<lint, lint>> segs;
    while (n--) {
        lint x;
        std::cin >> x;
        std::pair<lint, lint> p(x, 1);

        while (!segs.empty()) {
            auto a = segs.back();
            if (a.first * p.second < a.second * p.first) {
                segs.push_back(p);
                break;
            } else {
                p.first += a.first;
                p.second += a.second;
                segs.pop_back();
            }
        }
        if (segs.empty()) segs.push_back(p);
    }

    std::cout << std::fixed << std::setprecision(10);
    for (auto p : segs) {
        ldouble ave = ldouble(p.first) / p.second;
        for (int i = 0; i < p.second; ++i) {
            std::cout << ave << "\n";
        }
    }
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>

using lint = long long;
using ldouble = long double;

void solve() {
    int n;
    std::cin >> n;

    std::vector<std::pair<lint, lint>> segs;
    while (n--) {
        lint x;
        std::cin >> x;
        segs.emplace_back(x, 1);

        while (segs.size() >= 2) {
            auto b = segs.back();
            segs.pop_back();
            auto& a = segs.back();
            if (a.first * b.second < a.second * b.first) {
                segs.push_back(b);
                break;
            } else {
                a.first += b.first;
                a.second += b.second;
            }
        }
    }

    std::cout << std::fixed << std::setprecision(10);
    for (auto p : segs) {
        ldouble ave = ldouble(p.first) / p.second;
        for (int i = 0; i < p.second; ++i) {
            std::cout << ave << "\n";
        }
    }
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>

using lint = long long;
using ldouble = long double;

void solve() {
    int n;
    std::cin >> n;

    std::vector<std::pair<lint, lint>> segs;
    while (n--) {
        lint x;
        std::cin >> x;
        segs.emplace_back(x, 1);

        while (segs.size() >= 2) {
            auto b = segs.back();
            segs.pop_back();
            auto& a = segs.back();
            if (a.first * b.second < a.second * b.first) {
                segs.push_back(b);
                break;
            } else {
                a.first += b.first;
                a.second += b.second;
            }
        }
    }

    for (auto p : segs) {
        ldouble ave = ldouble(p.first) / p.second;
        for (int i = 0; i < p.second; ++i) {
            std::cout << std::fixed << std::setprecision(15) << ave << "\n";
        }
    }
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>

using lint = long long;
using ldouble = long double;

void solve() {
    int n;
    std::cin >> n;

    std::vector<std::pair<lint, lint>> segs;
    while (n--) {
        lint x;
        std::cin >> x;
        std::pair<lint, lint> p(x, 1);

        while (!segs.empty()) {
            auto a = segs.back();
            if (a.first * p.second < a.second * p.first) {
                segs.push_back(p);
                break;
            } else {
                p.first += a.first;
                p.second += a.second;
                segs.pop_back();
            }
        }
        if (segs.empty()) segs.push_back(p);
    }

    std::cout << std::fixed << std::setprecision(10);
    for (auto p : segs) {
        ldouble ave = ldouble(p.first) / p.second;
        for (int i = 0; i < p.second; ++i) {
            std::cout << ave << "\n";
        }
    }
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>

using lint = long long;
using ldouble = long double;

void solve() {
    int n;
    std::cin >> n;

    std::vector<std::pair<lint, lint>> segs;
    while (n--) {
        lint x;
        std::cin >> x;
        segs.emplace_back(x, 1);

        while (segs.size() >= 2) {
            auto b = segs.back();
            segs.pop_back();
            auto& a = segs.back();
            if (a.first * b.second < a.second * b.first) {
                segs.push_back(b);
                break;
            } else {
                a.first += b.first;
                a.second += b.second;
            }
        }
    }

    std::cout << std::fixed << std::setprecision(15);
    for (auto p : segs) {
        ldouble ave = ldouble(p.first) / p.second;
        for (int i = 0; i < p.second; ++i) {
            std::cout << ave << "\n";
        }
    }
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int read()
{
	int out = 0, sgn = 1;
	char jp = getchar();
	while (jp != '-' && (jp < '0' || jp > '9'))
		jp = getchar();
	if (jp == '-')
		sgn = -1, jp = getchar();
	while (jp >= '0' && jp <= '9')
		out = out * 10 + jp - '0', jp = getchar();
	return out * sgn;
}
const int N = 1e6 + 10;
int n, a[N], tp = 0;
ll up[N], down[N];
int main()
{
	ios::sync_with_stdio(false);
	n = read();
	for (int i = 1; i <= n; ++i)
	{
		int x = read();
		++tp;
		up[tp] = x, down[tp] = 1;
		while (tp >= 2 && 1LL * up[tp - 1] * down[tp] >= 1LL * up[tp] * down[tp - 1])
		{
			up[tp - 1] += up[tp];
			down[tp - 1] += down[tp];
			tp--;
		}
	}
	for (int i = 1; i <= tp; ++i)
		for (int j = 1; j <= down[i]; ++j)
			cout << setprecision(12) << (long double)(up[i]) / down[i] << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int read()
{
	int out = 0, sgn = 1;
	char jp = getchar();
	while (jp != '-' && (jp < '0' || jp > '9'))
		jp = getchar();
	if (jp == '-')
		sgn = -1, jp = getchar();
	while (jp >= '0' && jp <= '9')
		out = out * 10 + jp - '0', jp = getchar();
	return out * sgn;
}
const int N = 1e6 + 10;
int n, a[N], tp = 0;
ll up[N], down[N];
int main()
{
	ios::sync_with_stdio(false);
	n = read();
	for (int i = 1; i <= n; ++i)
	{
		int x = read();
		++tp;
		up[tp] = x, down[tp] = 1;
		while (tp >= 2 && 1LL * up[tp - 1] * down[tp] >= 1LL * up[tp] * down[tp - 1])
		{
			up[tp - 1] += up[tp];
			down[tp - 1] += down[tp];
			tp--;
		}
	}
	for (int i = 1; i <= tp; ++i)
	{
		long double val = (long double)(up[i]) / down[i];
		for (int j = 1; j <= down[i]; ++j)
			cout << setprecision(12) << val << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int read()
{
	int out = 0, sgn = 1;
	char jp = getchar();
	while (jp != '-' && (jp < '0' || jp > '9'))
		jp = getchar();
	if (jp == '-')
		sgn = -1, jp = getchar();
	while (jp >= '0' && jp <= '9')
		out = out * 10 + jp - '0', jp = getchar();
	return out * sgn;
}
const int N = 1e6 + 10;
int n, a[N], tp = 0;
ll up[N], down[N];
int main()
{
	n = read();
	for (int i = 1; i <= n; ++i)
	{
		int x = read();
		++tp;
		up[tp] = x, down[tp] = 1;
		while (tp >= 2 && 1LL * up[tp - 1] * down[tp] >= 1LL * up[tp] * down[tp - 1])
		{
			up[tp - 1] += up[tp];
			down[tp - 1] += down[tp];
			tp--;
		}
	}
	for (int i = 1; i <= tp; ++i)
		for (int j = 1; j <= down[i]; ++j)
			cout << setprecision(12) << (long double)(up[i]) / down[i] << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int read()
{
	int out = 0, sgn = 1;
	char jp = getchar();
	while (jp != '-' && (jp < '0' || jp > '9'))
		jp = getchar();
	if (jp == '-')
		sgn = -1, jp = getchar();
	while (jp >= '0' && jp <= '9')
		out = out * 10 + jp - '0', jp = getchar();
	return out * sgn;
}
const int N = 1e6 + 10;
int n, a[N], tp = 0;
ll up[N], down[N];
int main()
{
	ios::sync_with_stdio(false);
	n = read();
	for (int i = 1; i <= n; ++i)
	{
		int x = read();
		++tp;
		up[tp] = x, down[tp] = 1;
		while (tp >= 2 && 1LL * up[tp - 1] * down[tp] >= 1LL * up[tp] * down[tp - 1])
		{
			up[tp - 1] += up[tp];
			down[tp - 1] += down[tp];
			tp--;
		}
	}
	for (int i = 1; i <= tp; ++i)
	{
		long double val = (long double)(up[i]) / down[i];
		for (int j = 1; j <= down[i]; ++j)
			cout << setprecision(12) << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int read()
{
	int out = 0, sgn = 1;
	char jp = getchar();
	while (jp != '-' && (jp < '0' || jp > '9'))
		jp = getchar();
	if (jp == '-')
		sgn = -1, jp = getchar();
	while (jp >= '0' && jp <= '9')
		out = out * 10 + jp - '0', jp = getchar();
	return out * sgn;
}
const int N = 1e6 + 10;
int n, a[N];
int main()
{
	n = read();
	for (int i = 1; i <= n; ++i)
		a[i] = read();
	for (int L = 1, R; L <= n; L = R + 1)
	{
		R = L;
		ll up = a[L], down = 1;
		while (R + 1 <= n && 1LL * up * (down + 1) >= 1LL * (up + a[R + 1]) * down)
		{
			++R;
			up += a[R];
			down++;
		}
		for (int i = 1; i <= R - L + 1; ++i)
			cout << setprecision(12) << (long double)(up)/down << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int read()
{
	int out = 0, sgn = 1;
	char jp = getchar();
	while (jp != '-' && (jp < '0' || jp > '9'))
		jp = getchar();
	if (jp == '-')
		sgn = -1, jp = getchar();
	while (jp >= '0' && jp <= '9')
		out = out * 10 + jp - '0', jp = getchar();
	return out * sgn;
}
const int N = 1e6 + 10;
int n, a[N], tp = 0;
ll up[N], down[N];
int main()
{
	n = read();
	for (int i = 1; i <= n; ++i)
	{
		int x = read();
		++tp;
		up[tp] = x, down[tp] = 1;
		while (tp >= 2 && 1LL * up[tp - 1] * down[tp] >= 1LL * up[tp] * down[tp - 1])
		{
			up[tp - 1] += up[tp];
			down[tp - 1] += down[tp];
			tp--;
		}
	}
	for (int i = 1; i <= tp; ++i)
	{
		double val = (double)(up[i]) / down[i];
		for (int j = 1; j <= down[i]; ++j)
			printf("%.12lf\n", val);
	}
	return 0;
}


//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <bits/stdc++.h>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <utility>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 998244353
#define PI 3.1415927
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> ii;
//priority_queue <lli, vector<lli>, greater<lli> > ti;
//priority_queue<pair<lli,pair<lli,lli>>>e;
vector <lli> p[200005],q[200005],f(200005,0) ,b(200005,0),a,d[30];
//vector<vector<lli>> d(300005,vector<lli>(18,0));
//vector<pair<lli,ii>>p[300005];
map<pair<lli,lli>,lli>mp;
//vector<pair<pair<lli, lli>,lli> > st;
//map<lli,lli> np;
//queue<lli> qy;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
void fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
lli find(lli x)
{
    if(f[x]==x)
        return x;
    else
        return f[x]=find(f[x]);
}
bool cmp(lli x,lli y)
{
    return x<y;
}
lli comb(lli i,lli j)
{
    lli k=f[i];
    lli g=(f[j]*(f[i-j]))%mod;
    lli h=bpow(g,mod-2);
    return (k*h)%mod;
}
/*void sieve()
{
    for(lli i=2;i<=sqrt(10000000);i++)
    {
        if(b[i]==0)
        {
            k.pb(i);
        for(lli j=2;i*j<=sqrt(10000000);j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    vector<double> a(n+1),b(n+1),f(n+1);
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    lli k=0;
    for(lli i=1;i<=n;i++)
    {
        k++;
        b[k]=a[i];
        f[k]=1;
        while(k>1 && b[k-1]>b[k])
        {
            //cout<<b[k-1]<<" "<<b[k]<<" "<<f[k]<<" "<<f[k-1]<<endl;
            b[k-1]=(b[k-1]*f[k-1]+b[k]*f[k])/(f[k-1]+f[k]);
            f[k-1]+=f[k];
            k--;
        }
    }
    for(lli i=1;i<=k;i++)
    {
        for(lli j=1;j<=f[i];j++)
        {
            cout<<fixed<<setprecision(9)<<b[i]<<endl;
        }
    }
}


//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <bits/stdc++.h>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <utility>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 998244353
#define PI 3.1415927
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> ii;
//priority_queue <lli, vector<lli>, greater<lli> > ti;
//priority_queue<pair<lli,pair<lli,lli>>>e;
//vector <lli> p[200005],q[200005],f(200005,0) ,b(200005,0),a,d[30];
//vector<vector<lli>> d(300005,vector<lli>(18,0));
//vector<pair<lli,ii>>p[300005];
//map<pair<lli,lli>,lli>mp;
//vector<pair<pair<lli, lli>,lli> > st;
//map<lli,lli> np;
//queue<lli> qy;
/*lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
void fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
lli find(lli x)
{
    if(f[x]==x)
        return x;
    else
        return f[x]=find(f[x]);
}
bool cmp(lli x,lli y)
{
    return x<y;
}
lli comb(lli i,lli j)
{
    lli k=f[i];
    lli g=(f[j]*(f[i-j]))%mod;
    lli h=bpow(g,mod-2);
    return (k*h)%mod;
}
void sieve()
{
    for(lli i=2;i<=sqrt(10000000);i++)
    {
        if(b[i]==0)
        {
            k.pb(i);
        for(lli j=2;i*j<=sqrt(10000000);j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
vector<double> a(2000005),b(2000005),f(2000005);
int main ()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    //vector<double> a(n+1),b(n+1),f(n+1);
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    lli k=0;
    for(lli i=1;i<=n;i++)
    {
        k++;
        b[k]=a[i];
        f[k]=1;
        while(k>1 && b[k-1]>b[k])
        {
            //cout<<b[k-1]<<" "<<b[k]<<" "<<f[k]<<" "<<f[k-1]<<endl;
            b[k-1]=(b[k-1]*f[k-1]+b[k]*f[k])/(f[k-1]+f[k]);
            f[k-1]+=f[k];
            k--;
        }
    }
    for(lli i=1;i<=k;i++)
    {
        for(lli j=1;j<=f[i];j++)
        {
            cout<<fixed<<setprecision(9)<<b[i]<<endl;
        }
    }
}


//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <bits/stdc++.h>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <utility>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 998244353
#define PI 3.1415927
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> ii;
//priority_queue <lli, vector<lli>, greater<lli> > ti;
//priority_queue<pair<lli,pair<lli,lli>>>e;
//vector <lli> p[200005],q[200005],f(200005,0) ,b(200005,0),a,d[30];
//vector<vector<lli>> d(300005,vector<lli>(18,0));
//vector<pair<lli,ii>>p[300005];
//map<pair<lli,lli>,lli>mp;
//vector<pair<pair<lli, lli>,lli> > st;
//map<lli,lli> np;
//queue<lli> qy;
/*lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
void fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
lli find(lli x)
{
    if(f[x]==x)
        return x;
    else
        return f[x]=find(f[x]);
}
bool cmp(lli x,lli y)
{
    return x<y;
}
lli comb(lli i,lli j)
{
    lli k=f[i];
    lli g=(f[j]*(f[i-j]))%mod;
    lli h=bpow(g,mod-2);
    return (k*h)%mod;
}
void sieve()
{
    for(lli i=2;i<=sqrt(10000000);i++)
    {
        if(b[i]==0)
        {
            k.pb(i);
        for(lli j=2;i*j<=sqrt(10000000);j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
vector<double> a(2000005),b(2000005),f(2000005);
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    //vector<double> a(n+1),b(n+1),f(n+1);
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    lli k=0;
    for(lli i=1;i<=n;i++)
    {
        k++;
        b[k]=a[i];
        f[k]=1;
        while(k>1 && b[k-1]>b[k])
        {
            //cout<<b[k-1]<<" "<<b[k]<<" "<<f[k]<<" "<<f[k-1]<<endl;
            b[k-1]=(b[k-1]*f[k-1]+b[k]*f[k])/(f[k-1]+f[k]);
            f[k-1]+=f[k];
            k--;
        }
    }
    for(lli i=1;i<=k;i++)
    {
        for(lli j=1;j<=f[i];j++)
        {
            cout<<fixed<<setprecision(9)<<b[i]<<endl;
        }
    }
}


//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <bits/stdc++.h>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <utility>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 998244353
#define PI 3.1415927
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> ii;
//priority_queue <lli, vector<lli>, greater<lli> > ti;
//priority_queue<pair<lli,pair<lli,lli>>>e;
//vector <lli> p[200005],q[200005],f(200005,0) ,b(200005,0),a,d[30];
//vector<vector<lli>> d(300005,vector<lli>(18,0));
//vector<pair<lli,ii>>p[300005];
//map<pair<lli,lli>,lli>mp;
//vector<pair<pair<lli, lli>,lli> > st;
//map<lli,lli> np;
//queue<lli> qy;
/*lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
void fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
lli find(lli x)
{
    if(f[x]==x)
        return x;
    else
        return f[x]=find(f[x]);
}
bool cmp(lli x,lli y)
{
    return x<y;
}
lli comb(lli i,lli j)
{
    lli k=f[i];
    lli g=(f[j]*(f[i-j]))%mod;
    lli h=bpow(g,mod-2);
    return (k*h)%mod;
}
void sieve()
{
    for(lli i=2;i<=sqrt(10000000);i++)
    {
        if(b[i]==0)
        {
            k.pb(i);
        for(lli j=2;i*j<=sqrt(10000000);j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
double ans[1000010];
int a[1000010],n,len[1000010],k;
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    for(int i=1;i<=n;i++){
        ans[++k]=a[i]*1.0;
        len[k]=1;
        while(k>1&&ans[k]<ans[k-1]){
            ans[k-1]=(ans[k]*len[k]*1.0+ans[k-1]*len[k-1]*1.0)/(len[k]*1.0+len[k-1]*1.0);
            len[k-1]+=len[k];
            k--;
        }
    }
    for(int i=1;i<=k;i++)
        for(int j=1;j<=len[i];j++)printf("%.10lf ",ans[i]);
}


//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <bits/stdc++.h>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <utility>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 998244353
#define PI 3.1415927
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> ii;
//priority_queue <lli, vector<lli>, greater<lli> > ti;
//priority_queue<pair<lli,pair<lli,lli>>>e;
vector <lli> p[200005],q[200005],f(200005,0) ,b(200005,0),a,d[30];
//vector<vector<lli>> d(300005,vector<lli>(18,0));
//vector<pair<lli,ii>>p[300005];
map<pair<lli,lli>,lli>mp;
//vector<pair<pair<lli, lli>,lli> > st;
//map<lli,lli> np;
//queue<lli> qy;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
void fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
lli find(lli x)
{
    if(f[x]==x)
        return x;
    else
        return f[x]=find(f[x]);
}
bool cmp(lli x,lli y)
{
    return x<y;
}
lli comb(lli i,lli j)
{
    lli k=f[i];
    lli g=(f[j]*(f[i-j]))%mod;
    lli h=bpow(g,mod-2);
    return (k*h)%mod;
}
/*void sieve()
{
    for(lli i=2;i<=sqrt(10000000);i++)
    {
        if(b[i]==0)
        {
            k.pb(i);
        for(lli j=2;i*j<=sqrt(10000000);j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    vector<ld> a(n+1),b(n+1),f(n+1);
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    lli k=0;
    for(lli i=1;i<=n;i++)
    {
        k++;
        b[k]=a[i];
        f[k]=1;
        while(k>1 && b[k-1]>b[k])
        {
            //cout<<b[k-1]<<" "<<b[k]<<" "<<f[k]<<" "<<f[k-1]<<endl;
            b[k-1]=(b[k-1]*f[k-1]+b[k]*f[k])/(f[k-1]+f[k]);
            f[k-1]+=f[k];
            k--;
        }
    }
    for(lli i=1;i<=k;i++)
    {
        for(lli j=1;j<=f[i];j++)
        {
            cout<<fixed<<setprecision(9)<<b[i]<<endl;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

#define f first
#define s second
#define pb push_back
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int)x.size()

#define FOR(x, y, z) for(int x = (y); x < (z); x++)
#define ROF(x, z, y) for(int x = (y-1); x >= (z); x--)
#define F0R(x, z) FOR(x, 0, z)
#define R0F(x, z) ROF(x, 0, z)
#define trav(x, y) for(auto&x:y)

using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;

template<class T> inline bool ckmin(T&a, T b) {return b < a ? a = b, 1 : 0;}
template<class T> inline bool ckmax(T&a, T b) {return b > a ? a = b, 1 : 0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const char nl = '\n';
const int mxN = 2e5 + 10;
const int MOD = 1e9 + 7;
const long long infLL = 1e18;

struct U{
    double val;
    int l, r;
};

int n; vector<double> a, ans;
stack<U> s;

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    ans = a = vector<double>(n);
    F0R(i, n){
        cin >> a[i];
        U x = {a[i], i, i};
        while(siz(s) && s.top().val > x.val){
            double sum1 = x.val * (x.r - x.l + 1);
            double sum2 = s.top().val * (s.top().r - s.top().l + 1);
            assert(s.top().r + 1 == x.l);
            x = {(sum1 + sum2)/(x.r - s.top().l + 1), s.top().l, x.r};
            s.pop();
        }
        s.push(x);
    }
    while(!s.empty()){
        U t = s.top();
        s.pop();
        FOR(i, t.l, t.r+1){
            ans[i] = t.val;
        }
    }
    F0R(i, n){
        cout << fixed << setprecision(9) << ans[i] << nl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define f first
#define s second
#define pb push_back
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int)x.size()

#define FOR(x, y, z) for(int x = (y); x < (z); x++)
#define ROF(x, z, y) for(int x = (y-1); x >= (z); x--)
#define F0R(x, z) FOR(x, 0, z)
#define R0F(x, z) ROF(x, 0, z)
#define trav(x, y) for(auto&x:y)

using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;

template<class T> inline bool ckmin(T&a, T b) {return b < a ? a = b, 1 : 0;}
template<class T> inline bool ckmax(T&a, T b) {return b > a ? a = b, 1 : 0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const char nl = '\n';
const int mxN = 2e5 + 10;
const int MOD = 1e9 + 7;
const long long infLL = 1e18;

struct U{
    double val;
    int l, r;
};

int n; vector<double> a, ans;
stack<U> s;

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    ans = a = vector<double>(n);
    F0R(i, n){
        cin >> a[i];
        U x = {a[i], i, i};
        while(siz(s) && s.top().val > x.val){
            double sum1 = x.val * (x.r - x.l + 1);
            double sum2 = s.top().val * (s.top().r - s.top().l + 1);
            assert(s.top().r + 1 == x.l);
            x = {(sum1 + sum2)/(x.r - s.top().l + 1), s.top().l, x.r};
            s.pop();
        }
        s.push(x);
    }
    while(!s.empty()){
        U t = s.top();
        s.pop();
        FOR(i, t.l, t.r+1){
            ans[i] = t.val;
        }
    }
    F0R(i, n){
        cout << fixed << setprecision(4) << ans[i] << nl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define f first
#define s second
#define pb push_back
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int)x.size()

#define FOR(x, y, z) for(int x = (y); x < (z); x++)
#define ROF(x, z, y) for(int x = (y-1); x >= (z); x--)
#define F0R(x, z) FOR(x, 0, z)
#define R0F(x, z) ROF(x, 0, z)
#define trav(x, y) for(auto&x:y)

using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;

template<class T> inline bool ckmin(T&a, T b) {return b < a ? a = b, 1 : 0;}
template<class T> inline bool ckmax(T&a, T b) {return b > a ? a = b, 1 : 0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const char nl = '\n';
const int mxN = 2e5 + 10;
const int MOD = 1e9 + 7;
const long long infLL = 1e18;

struct U{
    double val;
    int l, r;
};

int n; vector<double> a, ans;
stack<U> s;

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    ans = a = vector<double>(n);
    F0R(i, n){
        cin >> a[i];
        U x = {a[i], i, i};
        while(siz(s) && s.top().val > x.val){
            double sum1 = x.val * (x.r - x.l + 1);
            double sum2 = s.top().val * (s.top().r - s.top().l + 1);
            assert(s.top().r + 1 == x.l);
            x = {(sum1 + sum2)/(x.r - s.top().l + 1), s.top().l, x.r};
            s.pop();
        }
        s.push(x);
    }
    while(!s.empty()){
        U t = s.top();
        s.pop();
        FOR(i, t.l, t.r+1){
            ans[i] = t.val;
        }
    }
    F0R(i, n){
        cout << fixed << setprecision(6) << ans[i] << nl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define f first
#define s second
#define pb push_back
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int)x.size()

#define FOR(x, y, z) for(int x = (y); x < (z); x++)
#define ROF(x, z, y) for(int x = (y-1); x >= (z); x--)
#define F0R(x, z) FOR(x, 0, z)
#define R0F(x, z) ROF(x, 0, z)
#define trav(x, y) for(auto&x:y)

using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;

template<class T> inline bool ckmin(T&a, T b) {return b < a ? a = b, 1 : 0;}
template<class T> inline bool ckmax(T&a, T b) {return b > a ? a = b, 1 : 0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const char nl = '\n';
const int mxN = 2e5 + 10;
const int MOD = 1e9 + 7;
const long long infLL = 1e18;

struct U{
    double val;
    int l, r;
};

int n; vector<double> a, ans;
stack<U> s;

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    ans = a = vector<double>(n);
    F0R(i, n){
        cin >> a[i];
        U x = {a[i], i, i};
        while(siz(s) && s.top().val > x.val){
            double sum1 = x.val * (x.r - x.l + 1);
            double sum2 = s.top().val * (s.top().r - s.top().l + 1);
            assert(s.top().r + 1 == x.l);
            x = {(sum1 + sum2)/(x.r - s.top().l + 1), s.top().l, x.r};
            s.pop();
        }
        s.push(x);
    }
    while(!s.empty()){
        U t = s.top();
        s.pop();
        FOR(i, t.l, t.r+1){
            ans[i] = t.val;
        }
    }
    F0R(i, n){
        cout << fixed << setprecision(12) << ans[i] << nl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define f first
#define s second
#define pb push_back
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int)x.size()

#define FOR(x, y, z) for(int x = (y); x < (z); x++)
#define ROF(x, z, y) for(int x = (y-1); x >= (z); x--)
#define F0R(x, z) FOR(x, 0, z)
#define R0F(x, z) ROF(x, 0, z)
#define trav(x, y) for(auto&x:y)

using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;

template<class T> inline bool ckmin(T&a, T b) {return b < a ? a = b, 1 : 0;}
template<class T> inline bool ckmax(T&a, T b) {return b > a ? a = b, 1 : 0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const char nl = '\n';
const int mxN = 2e5 + 10;
const int MOD = 1e9 + 7;
const long long infLL = 1e18;

struct U{
    double val;
    int l, r;
};

int n; vector<int> a; vector<double> ans;
stack<U> s;

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    ans = vector<double>(n);
    a = vi(n);
    F0R(i, n){
        cin >> a[i];
        U x = {a[i], i, i};
        while(siz(s) && s.top().val > x.val){
            double sum1 = x.val * (x.r - x.l + 1);
            double sum2 = s.top().val * (s.top().r - s.top().l + 1);
            assert(s.top().r + 1 == x.l);
            x = {(sum1 + sum2)/(x.r - s.top().l + 1), s.top().l, x.r};
            s.pop();
        }
        s.push(x);
    }
    while(!s.empty()){
        U t = s.top();
        s.pop();
        FOR(i, t.l, t.r+1){
            ans[i] = t.val;
        }
    }
    cout << fixed << setprecision(9);
    F0R(i, n){
        cout << ans[i] << nl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define pdi pair<double, int>
#define mp make_pair

const int maxn = 1e6 + 5;
double A[maxn];

int main () {
  int n;
  cin >> n;
  stack<pdi> q;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    double now = A[i];
    int cnt = 1;
    while (!q.empty() && (now + q.top().first) / (cnt + q.top().second) < q.top().first / q.top().second) {
      cnt += q.top().second;
      now += q.top().first;
      q.pop();
    }
    // cout << now << " " << cnt << endl;
    q.push(mp(now, cnt));
  }

  stack<pdi> v;
  while (!q.empty()) {
    v.push(q.top());
    q.pop();
  }
  while (!v.empty()) {
    double cnt = v.top().second;
    double ans = v.top().first / cnt;
    v.pop();
    while (cnt--) {
      cout << setprecision(10) << fixed << ans << endl;
    }
  }

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 1e6 + 5;
double A[maxn];
double B[maxn], cnt[maxn];

int main () {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  int top = 0;
  for (int i = 0; i < n; i++) {
    double now = A[i];
    double cc = 1;
    while (top && (now + B[top]) / (cc + cnt[top]) < B[top] / cnt[top]) {
      now += B[top];
      cc += cnt[top];
      top--;
    }
    B[++top] = now;
    cnt[top] = cc;
  }
  for (int i = 1; i <= top; i++) {
    double ans = B[i] / cnt[i];
    for (int j = 0; j < cnt[i]; j++) {
      printf("%.9f\n", ans);
    }
  }

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define pdi pair<double, int>
#define mp make_pair

const int maxn = 1e6 + 5;
double A[maxn];

int main () {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  stack<pdi> q;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    double now = A[i];
    int cnt = 1;
    while (!q.empty() && (now + q.top().first) / (cnt + q.top().second) < q.top().first / q.top().second) {
      cnt += q.top().second;
      now += q.top().first;
      q.pop();
    }
    // cout << now << " " << cnt << endl;
    q.push(mp(now, cnt));
  }

  stack<pdi> v;
  while (!q.empty()) {
    v.push(q.top());
    q.pop();
  }
  while (!v.empty()) {
    double cnt = v.top().second;
    double ans = v.top().first / cnt;
    v.pop();
    while (cnt--) {
      cout << setprecision(10) << fixed << ans << endl;
    }
  }

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 1e6 + 5;
double A[maxn];
double B[maxn], cnt[maxn];

int main () {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%lf", &A[i]);

  int top = 0;

  for (int i = 0; i < n; i++) {
    double now = A[i];
    double cc = 1;
    while (top && (now + B[top]) / (cc + cnt[top]) < B[top] / cnt[top]) {
      now += B[top];
      cc += cnt[top];
      top--;
    }
    B[++top] = now;
    cnt[top] = cc;
  }
  for (int i = 1; i <= top; i++) {
    double ans = B[i] / cnt[i];
    for (int j = 0; j < cnt[i]; j++) {
      printf("%.9f\n", ans);
    }
  }

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 1e6 + 5;
double A[maxn];

int main () {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> A[i];
  vector<pair<double, int>> v;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    double sum = 0;
    double pre = 1e9;
    int flag = 1;
    for (int j = i; j <= n; j++) {
      sum += A[j];
      cnt++;
      if (sum / cnt > pre) {
        v.push_back(make_pair(pre, cnt - 1));
        i = j - 1;
        break;
      }
      pre = sum / cnt;
      if (j == n) {
        v.push_back(make_pair(sum / cnt, cnt));
        flag = 0;
        break;
      }
    }
    if (!flag) break;
  }
  for (auto i : v) {
    for (int j = 0; j < i.second; j++) {
      cout << fixed << setprecision(10) << i.first << endl;
    }
  }

  return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-10;
int n, a[N], siz, st = 1;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

//ld get(ld vl){
//    int l = st, r = siz;
//    while (l < r){
//        int md = (l + r + 1) >> 1;
//        if (fr[md] - E <= vl)
//            l = md;
//        else r = md - 1;
//    }
//    return l;
//}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){

        while (-K[st] < i) st++;

        while (st + 1 < siz){
            ld md = fr[st + 1];
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
            if (ld(K[st + 1]) * md + ld(B[st + 1]) - bas >= -E)
                st++;
            else break;
        }

        ld l = 1.0, r = 1e6;

        for (int it = 0; it < 80; it++){
            ld md = (l + r) / 2.0;
//            cerr << fixed << setprecision(10) << md << '\n';
            int ps = st;
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
//            cerr << fixed << setprecision(10) << bas << '\n';

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = st;
        int j = -K[ps];

        if (l > a[i]){
            l = a[i];
            j = i;
        }

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-12;
int n, a[N], siz, st = 1;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){

        while (-K[st] < i) st++;

        while (st < siz){
            ld md = fr[st + 1];
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
            if (ld(K[st]) * md + ld(B[st]) - bas >= -E)
                st++;
            else break;
        }

        ld l = 1.0, r = 1e6;

        for (int it = 0; it < 60; it++){
            ld md = (l + r) / 2.0;
            int ps = st;
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = st;
        int j = -K[ps];

        if (l > a[i]){
            l = a[i];
            j = i;
        }

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-10;
int n, a[N], siz, st = 1;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

//ld get(ld vl){
//    int l = st, r = siz;
//    while (l < r){
//        int md = (l + r + 1) >> 1;
//        if (fr[md] - E <= vl)
//            l = md;
//        else r = md - 1;
//    }
//    return l;
//}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){

        while (-K[st] < i) st++;

        while (st + 1 < siz){
            ld md = fr[st + 1];
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
            if (ld(K[st + 1]) * md + ld(B[st + 1]) - bas >= -E)
                st++;
            else break;
        }

        ld l = max((ld)1.0, fr[st]), r = 1e6;

        if (st + 1 < siz)
            r = fr[st + 1];

        for (int it = 0; it < 80; it++){
            ld md = (l + r) / 2.0;
//            cerr << fixed << setprecision(10) << md << '\n';
            int ps = st;
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
//            cerr << fixed << setprecision(10) << bas << '\n';

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = st;
        int j = -K[ps];

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-9;
int n, a[N], siz, st;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

//ld get(ld vl){
//    int l = st, r = siz;
//    while (l < r){
//        int md = (l + r + 1) >> 1;
//        if (fr[md] - E <= vl)
//            l = md;
//        else r = md - 1;
//    }
//    return l;
//}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){

        while (-K[st] < i) st++;

        while (st + 1 < siz){
            ld md = fr[st + 1];
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
            if (ld(K[st + 1]) * md + ld(B[st + 1]) - bas >= E)
                st++;
            else break;
        }

        ld l = max((ld)1.0, fr[st]), r = 1e6;

        if (st + 1 < siz)
            r = fr[st + 1];

        for (int it = 0; it < 80; it++){
            ld md = (l + r) / 2.0;
//            cerr << fixed << setprecision(10) << md << '\n';
            int ps = st;
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
//            cerr << fixed << setprecision(10) << bas << '\n';

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = st;
        int j = -K[ps];

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-12;
int n, a[N], siz, st = 1;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

//ld get(ld vl){
//    int l = st, r = siz;
//    while (l < r){
//        int md = (l + r + 1) >> 1;
//        if (fr[md] - E <= vl)
//            l = md;
//        else r = md - 1;
//    }
//    return l;
//}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){

        while (-K[st] < i) st++;

        while (st + 1 < siz){
            ld md = fr[st + 1];
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
            if (ld(K[st + 1]) * md + ld(B[st + 1]) - bas >= -E)
                st++;
            else break;
        }

        ld l = 1.0, r = 1e6;

        for (int it = 0; it < 80; it++){
            ld md = (l + r) / 2.0;
//            cerr << fixed << setprecision(10) << md << '\n';
            int ps = st;
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
//            cerr << fixed << setprecision(10) << bas << '\n';

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = st;
        int j = -K[ps];

        if (l > a[i]){
            l = a[i];
            j = i;
        }

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-9;
int n, a[N], siz, st;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

//ld get(ld vl){
//    int l = st, r = siz;
//    while (l < r){
//        int md = (l + r + 1) >> 1;
//        if (fr[md] - E <= vl)
//            l = md;
//        else r = md - 1;
//    }
//    return l;
//}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){
        ld l = 1, r = 1e6;

        while (-K[st] < i) st++;

        while (st + 1 < siz){
            ld md = fr[st + 1];
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
            if (ld(K[st + 1]) * md + ld(B[st + 1]) - bas >= E)
                st++;
            else break;
        }

        for (int it = 0; it < 60; it++){
            ld md = (l + r) / 2.0;
//            cerr << fixed << setprecision(10) << md << '\n';
            int ps = st;
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
//            cerr << fixed << setprecision(10) << bas << '\n';

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = st;
        int j = max(i, (int)-K[ps]);

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-9;
int n, a[N], siz, st;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

ld get(ld vl){
    int l = st, r = siz;
    while (l < r){
        int md = (l + r + 1) >> 1;
        if (fr[md] - E <= vl)
            l = md;
        else r = md - 1;
    }
    return l;
}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){
        ld l = 1, r = 1e6;

        while (-K[st] < i) st++;

        for (int it = 0; it < 60; it++){
            ld md = (l + r) / 2.0;
//            cerr << fixed << setprecision(10) << md << '\n';
            int ps = get(md);
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
//            cerr << fixed << setprecision(10) << bas << '\n';

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = get(l);
        int j = max(i, (int)-K[ps]);

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-12;
int n, a[N], siz, st = 1;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

//ld get(ld vl){
//    int l = st, r = siz;
//    while (l < r){
//        int md = (l + r + 1) >> 1;
//        if (fr[md] - E <= vl)
//            l = md;
//        else r = md - 1;
//    }
//    return l;
//}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){

        while (-K[st] < i) st++;

        while (st < siz){
            ld md = fr[st + 1];
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
            if (ld(K[st]) * md + ld(B[st]) - bas >= -E)
                st++;
            else break;
        }

        ld l = 1.0, r = 1e6;

        for (int it = 0; it < 60; it++){
            ld md = (l + r) / 2.0;
//            cerr << fixed << setprecision(10) << md << '\n';
            int ps = st;
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
//            cerr << fixed << setprecision(10) << bas << '\n';

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = st;
        int j = -K[ps];

        if (l > a[i]){
            l = a[i];
            j = i;
        }

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
#define MP make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ft first
#define sd second
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<class T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int N = 1000100;
const int N2 = N + N;
const int M = 2 * N;
const int oo = 2e9;
const ll OO = 1e18;
const int PW = 20;
const int md = int(1e9) + 7;
const ld E = 1e-10;
int n, a[N], siz, st;
ll pf[N], K[N], B[N];
ld fr[N];

ld get_cross_point(ll k1, ll k2, ll b1, ll b2){
    ld KK = (ld(k1) - ld(k2));
    ld BB = (ld(b2) - ld(b1));
    return BB / KK;
}

//ld get(ld vl){
//    int l = st, r = siz;
//    while (l < r){
//        int md = (l + r + 1) >> 1;
//        if (fr[md] - E <= vl)
//            l = md;
//        else r = md - 1;
//    }
//    return l;
//}

int main() {
#ifdef _LOCAL
    freopen("in.txt","r",stdin); // freopen("output.txt","w",stdout);
#else
//    freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    siz = 0;

    pf[0] = 0;
    for (int i = 1; i <= n; i++)
        pf[i] = pf[i - 1] + a[i];

    for (int i = 1; i <= n; i++){

        ll nk = -i, nb = pf[i];

        while (siz > 1){
            ld p1 = get_cross_point(K[siz], nk, B[siz], nb);
            ld p2 = fr[siz];
            if (p1 - E > p2) break;
            siz--;
        }

        siz++;

        if (siz == 1){
            fr[1] = -OO;
            K[1] = nk;
            B[1] = nb;
            continue;
        }

        fr[siz] = get_cross_point(nk, K[siz - 1], nb, B[siz - 1]);
        K[siz] = nk;
        B[siz] = nb;
    }

    for (int i = 1; i <= n; ){

        while (-K[st] < i) st++;

        while (st + 1 < siz){
            ld md = fr[st + 1];
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
            if (ld(K[st + 1]) * md + ld(B[st + 1]) - bas >= -E)
                st++;
            else break;
        }

        ld l = max((ld)1.0, fr[st]), r = 1e6;

        if (st + 1 < siz)
            r = fr[st + 1];

        for (int it = 0; it < 80; it++){
            ld md = (l + r) / 2.0;
//            cerr << fixed << setprecision(10) << md << '\n';
            int ps = st;
            ld bas = ld(pf[i - 1]) - (ld(i) - 1.0) * md;
//            cerr << fixed << setprecision(10) << bas << '\n';

            if (ld(K[ps]) * md + ld(B[ps]) - bas >= E)
                l = md;
            else r = md;
        }

        int ps = st;
        int j = -K[ps];

        for (int it = i; it <= j; it++)
            cout << fixed << setprecision(10) << l << '\n';

        i = j + 1;
    }

    return 0;
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;
constexpr int MAX = 1e6+5;
constexpr double INF = 1e12;

vector<int> hull;
vector<pair<double, int>> points;

double p[MAX];
double d[MAX];
int m[MAX];

int main() {
    int n;
    cin >> n;
    ll l = 0;
    for (int i = 1; i <= n; i++) {
        ll a;
        cin >> a;

        p[i] = p[i-1] + a;
        double slope = (p[i] - p[l])/(i-l);
        points.push_back(make_pair((p[i]-p[l]) / i, i));
    }
    sort(points.begin(), points.end(), [](pair<double,int> a, pair<double,int> b) { return a.first < b.first; });
    hull.push_back(0);
    for (auto pe : points) {
        if (pe.second > hull[hull.size()-1]) {
            hull.push_back(pe.second);
        }
    }

    for (int i = 0; i < hull.size()-1; i++) {
        double slope = (p[hull[i+1]]-p[hull[i]]) / (hull[i+1] - hull[i]);
        for (int j = hull[i]; j <= hull[i+1]; j++) {
            p[j] = p[hull[i]] + slope * (j-hull[i]);
        }
    }

    cout << fixed;
    cout << setprecision(9);
    for (int i = 1; i <= n; i++) {
        cout << p[i] - p[i-1] << endl;
    }
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;
constexpr int MAX = 1e6+5;
constexpr double INF = 1e12;

double p[MAX];
double d[MAX];
int m[MAX];

int main() {
    int n;
    cin >> n;
    ll l = 0;
    double best = INF;
    for (int i = 1; i <= n; i++) {
        ll a;
        cin >> a;

        p[i] = p[i-1] + a;
        double slope = (p[i] - p[l])/(i-l);
        //cout << i << " " << l << " " << slope << " " << best << " " << endl;
        if (slope > best) {
            for (int j = l; j < i; j++) {
                p[j] = (j-l)*best + p[l];
            }
            l = i-1;
            best = p[i] - p[i-1];
        } else {
            best = slope;
        }
    }
    if (l < n) {
        double slope = (p[n] - p[l])/(n-l);
        for (int j = l; j <= n; j++) {
            p[j] = (j-l)*slope + p[l];
        }
    }

    cout << fixed;
    cout << setprecision(9);
    for (int i = 1; i <= n; i++) {
        cout << p[i] - p[i-1] << endl;
    }
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;
constexpr int MAX = 1e6+5;
constexpr double INF = 1e12;

vector<int> hull;
vector<pair<double, int>> points;

double p[MAX];
double d[MAX];
int m[MAX];

int main() {
    int n;
    cin >> n;
    ll l = 0;
    double best = INF;
    for (int i = 1; i <= n; i++) {
        ll a;
        cin >> a;

        p[i] = p[i-1] + a;
        if (i > 1) {
            double slope = (p[i] - p[l])/(i-l);
            points.push_back(make_pair((p[i]-p[l]) / (i-1), i));
        }
    }
    sort(points.begin(), points.end(), [](pair<double,int> a, pair<double,int> b) { return a.first < b.first; });
    hull.push_back(0);
    for (auto pe : points) {
        if (pe.second > hull[hull.size()-1]) {
            hull.push_back(pe.second);
        }
    }

    for (int i = 0; i < hull.size()-1; i++) {
        double slope = (p[hull[i+1]]-p[hull[i]]) / (hull[i+1] - hull[i]);
        for (int j = hull[i]; j <= hull[i+1]; j++) {
            p[j] = p[hull[i]] + slope * (j-hull[i]);
        }
    }

    cout << fixed;
    cout << setprecision(9);
    for (int i = 1; i <= n; i++) {
        cout << p[i] - p[i-1] << endl;
    }
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;
constexpr int MAX = 1e6+5;
constexpr double INF = 1e12;

vector<int> hull;
vector<pair<double, int>> points;

double p[MAX];
double d[MAX];
int m[MAX];

int main() {
    int n;
    cin >> n;
    ll l = 0;
    for (int i = 1; i <= n; i++) {
        ll a;
        cin >> a;

        p[i] = p[i-1] + a;
        double slope = (p[i] - p[l])/(i-l);
        points.push_back(make_pair((p[i]-p[l]) / i, i));
    }
    sort(points.begin(), points.end(), [](pair<double,int> a, pair<double,int> b) { return a.first < b.first; });
    hull.push_back(0);
    for (auto pe : points) {
        if (pe.second <= hull[hull.size()-1]) continue;
        hull.push_back(pe.second);
        if (hull.size() >= 3) {
            int a = hull[hull.size()-3];
            int b = hull[hull.size()-2];
            int c = hull[hull.size()-1];
            double s1 = (p[b] - p[a]) / (b - a);
            double s2 = (p[c] - p[b]) / (c - b);
            if (s1 >= s2) {
               hull.pop_back();
               hull.pop_back();
               hull.push_back(c);
            }
        }
    }

    for (int i = 0; i < hull.size()-1; i++) {
        double slope = (p[hull[i+1]]-p[hull[i]]) / (hull[i+1] - hull[i]);
        for (int j = hull[i]; j <= hull[i+1]; j++) {
            p[j] = p[hull[i]] + slope * (j-hull[i]);
        }
    }

    cout << fixed;
    cout << setprecision(9);
    for (int i = 1; i <= n; i++) {
        cout << p[i] - p[i-1] << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<double, double> pt;

constexpr int MAX = 1e6+5;
constexpr double INF = 1e12;

vector<pt> lower;
vector<pt> points;

double p[MAX];
double d[MAX];
int m[MAX];

bool ccw(pt a, pt b, pt c) {
    return (b.first - a.first)*(c.second-a.second) - (b.second - a.second)*(c.first - a.first) > 0;
}

int main() {
    int n;
    cin >> n;
    points.push_back(make_pair(0,0));
    for (int i = 1; i <= n; i++) {
        ll a;
        cin >> a;

        p[i] = p[i-1] + a;
        points.push_back(make_pair(i, p[i]));
    }
    for (auto point : points) {
        while (lower.size() >= 2 && !ccw(lower[lower.size()-2], lower[lower.size()-1], point)) {
            lower.pop_back();
        }
        lower.push_back(point);
    }

    for (int i = 0; i < lower.size()-1; i++) {
        int a = lower[i].first;
        int b = lower[i+1].first;
        double slope = (p[b]-p[a]) / (b-a);
        for (int j = a; j <= b; j++) {
            p[j] = p[a] + slope * (j-a);
        }
    }

    cout << fixed;
    cout << setprecision(9);
    for (int i = 1; i <= n; i++) {
        cout << p[i] - p[i-1] << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<double, double> pt;

constexpr int MAX = 1e6+5;
constexpr double INF = 1e12;

vector<pt> lower;
vector<pt> points;

double p[MAX];
double d[MAX];
int m[MAX];

bool ccw(pt a, pt b, pt c) {
    return (b.first - a.first)*(c.second-a.second) - (b.second - a.second)*(c.first - a.first) > 0;
}

int main() {
    int n;
    cin >> n;
    points.push_back(make_pair(0,0));
    for (int i = 1; i <= n; i++) {
        ll a;
        cin >> a;

        p[i] = p[i-1] + a;
        points.push_back(make_pair(i, p[i]));
    }
    for (auto point : points) {
        while (lower.size() >= 2 && !ccw(lower[lower.size()-2], lower[lower.size()-1], point)) {
            lower.pop_back();
        }
        lower.push_back(point);
    }

    for (int i = 0; i < lower.size()-1; i++) {
        int a = lower[i].first;
        int b = lower[i+1].first;
        double slope = (p[b]-p[a]) / (b-a);
        for (int j = a; j <= b; j++) {
            p[j] = p[a] + slope * (j-a);
        }
    }

    cout << fixed;
    cout << setprecision(9);
    for (int i = 1; i <= n; i++) {
        cout << p[i] - p[i-1] << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define de(x,y) cout<<#x<<" :"<<x<<y;
#define int long long
typedef pair<int,int> pii;
typedef pair<double,int> pdi;
const int maxn = 1e6+5;

int arr[maxn];
vector<pair<double, int> > vt;

bool check(pdi a,pdi b) {
	if(a.X /(double)a.Y >= b.X / (double)b.Y)
		return 1;
	return 0;

}
double ans[maxn];
main() {
	int n;
	scanf("%d", &n);
	for(int i=1; i<=n; i++)
		scanf("%d", &arr[i]);
	for(int i=1; i<=n; i++) {
		pdi now = {arr[i], 1};
		while(vt.size()) {
			if(check(vt.back(), now)) {
				now.X += vt.back().X;
				now.Y += vt.back().Y;
				vt.pop_back();
			}
			else {
				break;
			}
		}
		vt.push_back(now);
	}
	int j = 1;
	for(int i=0; i<vt.size(); i++) {
		for(int j=0; j<vt[i].Y; j++) {
		 	printf("%.10f\n", vt[i].X / (double)vt[i].Y);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define de(x,y) cout<<#x<<" :"<<x<<y;
#define int long long
typedef pair<int,int> pii;
typedef pair<double,int> pdi;
const int maxn = 1e6+5;

int arr[maxn];
vector<pair<double, int> > vt;

bool check(pdi a,pdi b) {
	if(a.X /(double)a.Y >= b.X / (double)b.Y)
		return 1;
	return 0;

}
double ans[maxn];
main() {IOS
	int n;
	cin >> n;
	for(int i=1; i<=n; i++)
		cin >> arr[i];
	for(int i=1; i<=n; i++) {
		pdi now = {arr[i], 1};
		while(vt.size()) {
			if(check(vt.back(), now)) {
				now.X += vt.back().X;
				now.Y += vt.back().Y;
				vt.pop_back();
			}
			else {
				break;
			}
		}
		vt.push_back(now);
	}
	int j = 1;
	for(int i=0; i<vt.size(); i++) {
		for(int j=0; j<vt[i].Y; j++) {
		 	printf("%.10f\n", vt[i].X / (double)vt[i].Y);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define de(x,y) cout<<#x<<" :"<<x<<y;
#define int long long
typedef pair<int,int> pii;
typedef pair<double,int> pdi;
const int maxn = 1e6+5;

int arr[maxn];
vector<pair<double, int> > vt;

bool check(pdi a,pdi b) {
	if(a.X /(double)a.Y >= b.X / (double)b.Y)
		return 1;
	return 0;

}
double ans[maxn];
main() {
	scanf("%d", &n);
	cin >> n;
	for(int i=1; i<=n; i++)
		scanf("%d", &arr[i]);
	for(int i=1; i<=n; i++) {
		pdi now = {arr[i], 1};
		while(vt.size()) {
			if(check(vt.back(), now)) {
				now.X += vt.back().X;
				now.Y += vt.back().Y;
				vt.pop_back();
			}
			else {
				break;
			}
		}
		vt.push_back(now);
	}
	int j = 1;
	for(int i=0; i<vt.size(); i++) {
		for(int j=0; j<vt[i].Y; j++) {
		 	printf("%.10f ", vt[i].X / (double)vt[i].Y);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define de(x,y) cout<<#x<<" :"<<x<<y;
#define int long long
typedef pair<int,int> pii;
typedef pair<double,int> pdi;
const int maxn = 1e6+5;

int arr[maxn];
vector<pair<double, int> > vt;

bool check(pdi a,pdi b) {
	if(a.X /(double)a.Y >= b.X / (double)b.Y)
		return 1;
	return 0;

}
double ans[maxn];
main() {
	int n;
	scanf("%d", &n);
	for(int i=1; i<=n; i++)
		scanf("%d", &arr[i]);
	for(int i=1; i<=n; i++) {
		pdi now = {arr[i], 1};
		while(vt.size()) {
			if(check(vt.back(), now)) {
				now.X += vt.back().X;
				now.Y += vt.back().Y;
				vt.pop_back();
			}
			else {
				break;
			}
		}
		vt.push_back(now);
	}
	int j = 1;
	for(int i=0; i<vt.size(); i++) {
		for(int j=0; j<vt[i].Y; j++) {
		 	printf("%.10f \n
			 ", vt[i].X / (double)vt[i].Y);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define de(x,y) cout<<#x<<" :"<<x<<y;
#define int long long
typedef pair<int,int> pii;
typedef pair<double,int> pdi;
const int maxn = 1e6+5;

int arr[maxn];
vector<pair<double, int> > vt;

bool check(pdi a,pdi b) {
	if(a.X /(double)a.Y >= b.X / (double)b.Y)
		return 1;
	return 0;

}
double ans[maxn];
main() {
	int n;
	scanf("%lld", &n);
	for(int i=1; i<=n; i++)
		scanf("%lld", &arr[i]);
	for(int i=1; i<=n; i++) {
		pdi now = {arr[i], 1};
		while(vt.size()) {
			if(check(vt.back(), now)) {
				now.X += vt.back().X;
				now.Y += vt.back().Y;
				vt.pop_back();
			}
			else {
				break;
			}
		}
		vt.push_back(now);
	}
	int j = 1;
	for(int i=0; i<vt.size(); i++) {
		for(int j=0; j<vt[i].Y; j++) {
		 	printf("%.10f\n", vt[i].X / (double)vt[i].Y);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define de(x,y) cout<<#x<<" :"<<x<<y;
#define int long long
typedef pair<int,int> pii;
typedef pair<double,int> pdi;
const int maxn = 1e6+5;

int arr[maxn];
vector<pair<double, int> > vt;

bool check(pdi a,pdi b) {
	if(a.X * b.Y >= b.X * a.Y)
		return 1;
	return 0;

}
double ans[maxn];
main() {
	int n;
	scanf("%lld", &n);
	for(int i=1; i<=n; i++)
		scanf("%lld", &arr[i]);
	for(int i=1; i<=n; i++) {
		pdi now = {arr[i], 1};
		while(vt.size()) {
			if(check(vt.back(), now)) {
				now.X += vt.back().X;
				now.Y += vt.back().Y;
				vt.pop_back();
			}
			else {
				break;
			}
		}
		vt.push_back(now);
	}
	int j = 1;
	for(int i=0; i<vt.size(); i++) {
		for(int j=0; j<vt[i].Y; j++) {
		 	printf("%.10f\n", vt[i].X / (double)vt[i].Y);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define de(x,y) cout<<#x<<" :"<<x<<y;
#define int long long
typedef pair<int,int> pii;
typedef pair<double,int> pdi;
const int maxn = 1e6+5;

int arr[maxn];
vector<pair<double, int> > vt;

bool check(pdi a,pdi b) {
	if(a.X /(double)a.Y >= b.X / (double)b.Y)
		return 1;
	return 0;

}
double ans[maxn];
main() {
	int n;
	cin >> n;
	for(int i=1; i<=n; i++)
		cin >> arr[i];
	for(int i=1; i<=n; i++) {
		pdi now = {arr[i], 1};
		while(vt.size()) {
			if(check(vt.back(), now)) {
				now.X += vt.back().X;
				now.Y += vt.back().Y;
				vt.pop_back();
			}
			else {
				break;
			}
		}
		cout << now.X << " " << now.Y << "\n";
		vt.push_back(now);
	}
	for(auto a:vt) {
		cout << a.X << ' ' << a.Y << "\n";
	}
	int j = 1;
	for(int i=0; i<vt.size(); i++) {
		for(int j=0; j<vt[i].Y; j++) {
		 	printf("%.10f ", vt[i].X / (double)vt[i].Y);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define de(x,y) cout<<#x<<" :"<<x<<y;
#define int long long
typedef pair<int,int> pii;
typedef pair<double,int> pdi;
const int maxn = 1e6+5;

int arr[maxn];
vector<pair<double, int> > vt;

bool check(pdi a,pdi b) {
	if(a.X /(double)a.Y >= b.X / (double)b.Y)
		return 1;
	return 0;

}
double ans[maxn];
main() {
	int n;
	scanf("%d", &n);
	for(int i=1; i<=n; i++)
		scanf("%d", &arr[i]);
	for(int i=1; i<=n; i++) {
		pdi now = {arr[i], 1};
		while(vt.size()) {
			if(check(vt.back(), now)) {
				now.X += vt.back().X;
				now.Y += vt.back().Y;
				vt.pop_back();
			}
			else {
				break;
			}
		}
		vt.push_back(now);
	}
	int j = 1;
	for(int i=0; i<vt.size(); i++) {
		for(int j=0; j<vt[i].Y; j++) {
		 	printf("%.10f ", vt[i].X / (double)vt[i].Y);
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long int n,k,i,j;
	cin>>n;
	vector<int> a;
	for(i=0;i<n;i++)
	{
		cin>>k;
		a.push_back(k);
	}
	sort(a.rbegin(),a.rend());
	int z;
	cin>>z;
	int b[z];
	for(i=0;i<z;i++)
	{
		int sum=0,k;
		cin>>b[i];
		j=0;
		for(k=0;k<b[i]-1;k++)
		{
			//cout<<a.at(j)<<"\n";
			sum+=a.at(j);
			j++;
		}
		for(k=b[i];k<a.size();k++)
		{
			sum+=a.at(k);
		}
		cout<<sum<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,m,i,j,k,count=0;
    cin>>n;
    int a[n];

    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }

    k = sizeof(a)/sizeof(a[0]);
    sort(a,a+k);

    for(i=0; i<n; i++)
            count+=a[i];

            //cout<<count<<endl;

            int x = count;
    /*for(i=0;i<n;i++)
    {
        cout<<a[i];
    }*/

    cin>>m;
    while(m--)
    {
        count = x;
        cin>>j;
        /*for(i=n-1; i>(n-j); i--)
            count+=a[i];
        for(i=0; i<n-j; i++)
            count+=a[i];*/
            count = count - a[n-j];

            cout<<count<<endl;

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,count=0;
    cin>>n;
    int a[n];

    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }

    k = sizeof(a)/sizeof(a[0]);
    sort(a,a+k);

    for(i=0; i<n; i++)
            count+=a[i];

            int x = count;
    /*for(i=0;i<n;i++)
    {
        cout<<a[i];
    }*/

    cin>>m;
    while(m--)
    {
        count = x;
        cin>>j;
        /*for(i=n-1; i>(n-j); i--)
            count+=a[i];
        for(i=0; i<n-j; i++)
            count+=a[i];*/
            count = count - a[n-j];

            cout<<count<<endl;

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,count=0;
    cin>>n;
    int a[n];

    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }

    k = sizeof(a)/sizeof(a[0]);
    sort(a,a+k);

    /*for(i=0;i<n;i++)
    {
        cout<<a[i];
    }*/

    cin>>m;
    while(m--)
    {
        count = 0;
        cin>>j;
        for(i=n-1; i>(n-j); i--)
            count+=a[i];
        for(i=0; i<n-j; i++)
            count+=a[i];

            cout<<count<<endl;

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,m,i,j,k,count=0;
    cin>>n;
    int a[n];

    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }

    k = sizeof(a)/sizeof(a[0]);
    sort(a,a+k);

    for(i=0; i<n; i++)
            count+=a[i];

            cout<<count<<endl;

            int x = count;
    /*for(i=0;i<n;i++)
    {
        cout<<a[i];
    }*/

    cin>>m;
    while(m--)
    {
        count = x;
        cin>>j;
        /*for(i=n-1; i>(n-j); i--)
            count+=a[i];
        for(i=0; i<n-j; i++)
            count+=a[i];*/
            count = count - a[n-j];

            cout<<count<<endl;

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    unsigned long long int n,m,i,j,k,count=0;
    cin>>n;
    unsigned long long int a[n];

    for(i=0; i<n; i++)
    {
        cin>>a[i];
        count+=a[i];
    }

    k = sizeof(a)/sizeof(a[0]);
    sort(a,a+k);

    /*for(i=0; i<n; i++)
            count+=a[i];*/

            //cout<<count<<endl;

            long long int x = count;
    /*for(i=0;i<n;i++)
    {
        cout<<a[i];
    }*/

    cin>>m;
    while(m--)
    {
        count = x;
        cin>>j;
        /*for(i=n-1; i>(n-j); i--)
            count+=a[i];
        for(i=0; i<n-j; i++)
            count+=a[i];*/
            count = count - a[n-j];

            cout<<count<<endl;

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    unsigned long long int n,m,i,j,k,count=0;
    cin>>n;
    unsigned long long int a[n];

    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }

    k = sizeof(a)/sizeof(a[0]);
    sort(a,a+k);

    for(i=0; i<n; i++)
            count+=a[i];

            //cout<<count<<endl;

            int x = count;
    /*for(i=0;i<n;i++)
    {
        cout<<a[i];
    }*/

    cin>>m;
    while(m--)
    {
        count = x;
        cin>>j;
        /*for(i=n-1; i>(n-j); i--)
            count+=a[i];
        for(i=0; i<n-j; i++)
            count+=a[i];*/
            count = count - a[n-j];

            cout<<count<<endl;

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,m,i,j,k,count=0;
    cin>>n;
    long long int a[n];

    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }

    k = sizeof(a)/sizeof(a[0]);
    sort(a,a+k);

    for(i=0; i<n; i++)
            count+=a[i];

            //cout<<count<<endl;

            int x = count;
    /*for(i=0;i<n;i++)
    {
        cout<<a[i];
    }*/

    cin>>m;
    while(m--)
    {
        count = x;
        cin>>j;
        /*for(i=n-1; i>(n-j); i--)
            count+=a[i];
        for(i=0; i<n-j; i++)
            count+=a[i];*/
            count = count - a[n-j];

            cout<<count<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int m;
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
        cin>>b[i];
    for(int i=0;i<m;i++)
    {
        int temp=b[i]-1;
        int j=n-1;
        int cost=0;
        while(temp--)
        {
            cost+=a[j];
            j--;
        }
        j--;
        for(int i=0;i<=j;i++)
            cost+=a[i];
        cout<<cost<<endl;
    }
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[n+1];
    for(int i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=2;i<=n;i++)
        a[i]+=a[i-1];
    int m;
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
        cin>>b[i];
    for(int i=0;i<m;i++)
    {
        int temp=b[i];
      //  cout<<a[temp]<<endl<<a[n]<<endl<<a[n-temp+1]<<endl;
        cout<<a[n-temp]+a[n]-a[n-temp+1]<<endl;
    }
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long int a[n+1];
    for(int i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=2;i<=n;i++)
        a[i]+=a[i-1];
    int m;
    #define int long long
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
        cin>>b[i];
    for(int i=0;i<m;i++)
    {
        int temp=b[i];
      //  cout<<a[temp]<<endl<<a[n]<<endl<<a[n-temp+1]<<endl;
        cout<<a[n-temp]+a[n]-a[n-temp+1]<<endl;
    }
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[n+1];
    for(int i=1;i<=n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=2;i<=n;i++)
        a[i]+=a[i-1];
    int m;
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
        cin>>b[i];
    for(int i=0;i<m;i++)
    {
        int temp=b[i];
      //  cout<<a[temp]<<endl<<a[n]<<endl<<a[n-temp+1]<<endl;
        cout<<a[n-temp]+a[n]-a[n-temp+1]<<endl;
    }
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long int a[n+1];
    for(int i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=2;i<=n;i++)
        a[i]+=a[i-1];
    int m;
    #define int long long
    a[0]=0;
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
        cin>>b[i];
    for(int i=0;i<m;i++)
    {
        int temp=b[i];
      //  cout<<a[temp]<<endl<<a[n]<<endl<<a[n-temp+1]<<endl;
        cout<<a[n-temp]+a[n]-a[n-temp+1]<<endl;
    }
}


#include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[300005],ans[300005];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+n+1);
	cin>>m;
	for(int i=1;i<=m;i++){
		int b,x;
		cin>>b;
		x=n-b+1;
		for(int j=1;j<=n;j++){
			if(j==x) continue;
			ans[i]+=a[j];
		}
	}
	for(int i=1;i<=m;i++) cout<<ans[i]<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
long long n,m,a[300005],ans[300005],s[300005],sum;
bool cmp(int x,int y){return x>y;}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) {
	cin>>a[i];
	sum+=a[i];
	}
	sort(a+1,a+n+1,cmp);
	cin>>m;
	for(int i=1;i<=m;i++){
		int b;
		cin>>b;
		cout<<sum-a[b]<<endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[233333],ans[233333];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+n+1);
	cin>>m;
	for(int i=1;i<=m;i++){
		int b,x;
		cin>>b;
		x=n-b+1;
		for(int j=1;j<=n;j++){
			if(j==x) continue;
			ans[i]+=a[j];
		}
	}
	for(int i=1;i<=m;i++) cout<<ans[i]<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[300005],ans[300005],s[300005];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+n+1);
	cin>>m;
	for(int i=1;i<=n;i++){
		s[i]=s[i-1]+a[i];
	}
	for(int i=1;i<=m;i++){
		int b,x;
		cin>>b;
		x=n-b+1;
		ans[i]+=s[n-b]+s[n]-s[x];
	}
	for(int i=1;i<=m;i++) cout<<ans[i]<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[300005],ans[300005],s[300005],sum;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) {
	cin>>a[i];
	sum+=a[i];
	}
	sort(a+1,a+n+1);
	cin>>m;
	for(int i=1;i<=m;i++){
		int b,x;
		cin>>b;
		x=n-b+1;
		ans[i]+=sum-a[x];
	}
	for(int i=1;i<=m;i++) cout<<ans[i]<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[300005],ans[300005],s[300005],sum;
bool cmp(int x,int y){return x>y;}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) {
	cin>>a[i];
	sum+=a[i];
	}
	sort(a+1,a+n+1,cmp);
	cin>>m;
	for(int i=1;i<=m;i++){
		int b;
		cin>>b;
		cout<<sum-a[b]<<endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[233333333],ans[23333333];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+n+1);
	cin>>m;
	for(int i=1;i<=m;i++){
		int b,x;
		cin>>b;
		x=n-b+1;
		for(int j=1;j<=n;j++){
			if(j==x) continue;
			ans[i]+=a[j];
		}
	}
	for(int i=1;i<=m;i++) cout<<ans[i]<<endl;
	return 0;
}


/*                                              +---------------------+
					        | BRYAN MAURICIO 2006 |
                                                +---------------------+
*/
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define ar array

#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define allr(c) (c).rbegin(), (c).rend()
#define sz(x) (int)(x).size()
#define mx(a) *max_element(all(a))
#define mn(a) *min_element(all(a))
#define pi 3.14159265358979323846
#define lcm(a, b)  (a * b) / ( __gcd(a, b ) )
#define gcd(a,b) __gcd(a,b)
#define tests int t; cin>>t; while(t--)
#define test int t=1;while(t--)
#define mod 1000000007
#define srt(y) sort(all(y))
#define srtr(y) sort(allr(y))
#define uniq(y) y.erase(unique(all(y)), y.end())

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)

template<class T> bool umin(T& a, const T& b) {
	return b<a?a=b, 1:0;
}
template<class T> bool umax(T& a, const T& b) {
	return a<b?a=b, 1:0;
}

ll FIRSTTRUE(function<bool(ll)> f, ll lb, ll rb) {
	while(lb<rb) {
		ll mb=(lb+rb)/2;
		f(mb)?rb=mb:lb=mb+1;
	}
	return lb;
}
ll LASTTRUE(function<bool(ll)> f, ll lb, ll rb) {
	while(lb<rb) {
		ll mb=(lb+rb+1)/2;
		f(mb)?lb=mb:rb=mb-1;
	}
	return lb;
}

template<class A> void read(vt<A>& v);
template<class A, size_t S> void read(ar<A, S>& a);
template<class T> void read(T& x) {
	cin >> x;
}
void read(double& d) {
	string t;
	read(t);
	d=stod(t);
}
void read(long double& d) {
	string t;
	read(t);
	d=stold(t);
}
template<class H, class... T> void read(H& h, T&... t) {
	read(h);
	read(t...);
}
template<class A> void read(vt<A>& x) {
	EACH(a, x)
		read(a);
}
template<class A, size_t S> void read(array<A, S>& x) {
	EACH(a, x)
		read(a);
}

string to_string(char c) {
	return string(1, c);
}
string to_string(bool b) {
	return b?"true":"false";
}
string to_string(const char* s) {
	return string(s);
}
string to_string(string s) {
	return s;
}
string to_string(vt<bool> v) {
	string res;
	FOR(sz(v))
		res+=char('0'+v[i]);
	return res;
}

template<size_t S> string to_string(bitset<S> b) {
	string res;
	FOR(S)
		res+=char('0'+b[i]);
	return res;
}
template<class T> string to_string(T v) {
    bool f=1;
    string res;
    EACH(x, v) {
		if(!f)
			res+=' ';
		f=0;
		res+=to_string(x);
	}
    return res;
}

template<class A> void write(A x) {
	cout << to_string(x);
}
template<class H, class... T> void write(const H& h, const T&... t) {
	write(h);
	write(t...);
}
void print() {
	write("\n");
}
template<class H, class... T> void print(const H& h, const T&... t) {
	write(h);
	if(sizeof...(t))
		write(' ');
	print(t...);
}

void DBG() {
	cerr << "]" << endl;
}
template<class H, class... T> void DBG(H h, T... t) {
	cerr << to_string(h);
	if(sizeof...(t))
		cerr << ", ";
	DBG(t...);
}
#ifdef _DEBUG
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

template<class T> void offset(ll o, T& x) {
	x+=o;
}
template<class T> void offset(ll o, vt<T>& x) {
	EACH(a, x)
		offset(o, a);
}
template<class T, size_t S> void offset(ll o, ar<T, S>& x) {
	EACH(a, x)
		offset(o, a);
}

mt19937 mt_rng(chrono::steady_clock::now().time_since_epoch().count());
ll randint(ll a, ll b) {
	return uniform_int_distribution<ll>(a, b)(mt_rng);
}

template<class T, class U> void vti(vt<T> &v, U x, size_t n) {
	v=vt<T>(n, x);
}
template<class T, class U> void vti(vt<T> &v, U x, size_t n, size_t m...) {
	v=vt<T>(n);
	EACH(a, v)
		vti(a, x, m);
}

const int d4i[4]={-1, 0, 1, 0}, d4j[4]={0, 1, 0, -1};
const int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};

void solve() {
    int a;
    read(a);
    vt<ll> y(a);
    read(y);
    int b;
    read(b);
    vt<ll> x(b);
    read(x);
    srtr(y);
    ll ans = 0;
    for(int j = 0;j<a;j++) {
        ans+=y[j];
    }
    for(int i = 0;i<b;i++) {
        ll h = ans,u=x[i];
        ans-=y[u-1];
        print(ans);
        ans=h;
    }
}

int main() {
    ios;

    test {
        solve();
    }
}


/*                                              +---------------------+
					        | BRYAN MAURICIO 2006 |
                                                +---------------------+
*/
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define ar array

#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define allr(c) (c).rbegin(), (c).rend()
#define sz(x) (int)(x).size()
#define mx(a) *max_element(all(a))
#define mn(a) *min_element(all(a))
#define pi 3.14159265358979323846
#define lcm(a, b)  (a * b) / ( __gcd(a, b ) )
#define gcd(a,b) __gcd(a,b)
#define tests int t; cin>>t; while(t--)
#define test int t=1;while(t--)
#define mod 1000000007
#define srt(y) sort(all(y))
#define srtr(y) sort(allr(y))
#define uniq(y) y.erase(unique(all(y)), y.end())

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)

template<class T> bool umin(T& a, const T& b) {
	return b<a?a=b, 1:0;
}
template<class T> bool umax(T& a, const T& b) {
	return a<b?a=b, 1:0;
}

ll FIRSTTRUE(function<bool(ll)> f, ll lb, ll rb) {
	while(lb<rb) {
		ll mb=(lb+rb)/2;
		f(mb)?rb=mb:lb=mb+1;
	}
	return lb;
}
ll LASTTRUE(function<bool(ll)> f, ll lb, ll rb) {
	while(lb<rb) {
		ll mb=(lb+rb+1)/2;
		f(mb)?lb=mb:rb=mb-1;
	}
	return lb;
}

template<class A> void read(vt<A>& v);
template<class A, size_t S> void read(ar<A, S>& a);
template<class T> void read(T& x) {
	cin >> x;
}
void read(double& d) {
	string t;
	read(t);
	d=stod(t);
}
void read(long double& d) {
	string t;
	read(t);
	d=stold(t);
}
template<class H, class... T> void read(H& h, T&... t) {
	read(h);
	read(t...);
}
template<class A> void read(vt<A>& x) {
	EACH(a, x)
		read(a);
}
template<class A, size_t S> void read(array<A, S>& x) {
	EACH(a, x)
		read(a);
}

string to_string(char c) {
	return string(1, c);
}
string to_string(bool b) {
	return b?"true":"false";
}
string to_string(const char* s) {
	return string(s);
}
string to_string(string s) {
	return s;
}
string to_string(vt<bool> v) {
	string res;
	FOR(sz(v))
		res+=char('0'+v[i]);
	return res;
}

template<size_t S> string to_string(bitset<S> b) {
	string res;
	FOR(S)
		res+=char('0'+b[i]);
	return res;
}
template<class T> string to_string(T v) {
    bool f=1;
    string res;
    EACH(x, v) {
		if(!f)
			res+=' ';
		f=0;
		res+=to_string(x);
	}
    return res;
}

template<class A> void write(A x) {
	cout << to_string(x);
}
template<class H, class... T> void write(const H& h, const T&... t) {
	write(h);
	write(t...);
}
void print() {
	write("\n");
}
template<class H, class... T> void print(const H& h, const T&... t) {
	write(h);
	if(sizeof...(t))
		write(' ');
	print(t...);
}

void DBG() {
	cerr << "]" << endl;
}
template<class H, class... T> void DBG(H h, T... t) {
	cerr << to_string(h);
	if(sizeof...(t))
		cerr << ", ";
	DBG(t...);
}
#ifdef _DEBUG
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

template<class T> void offset(ll o, T& x) {
	x+=o;
}
template<class T> void offset(ll o, vt<T>& x) {
	EACH(a, x)
		offset(o, a);
}
template<class T, size_t S> void offset(ll o, ar<T, S>& x) {
	EACH(a, x)
		offset(o, a);
}

mt19937 mt_rng(chrono::steady_clock::now().time_since_epoch().count());
ll randint(ll a, ll b) {
	return uniform_int_distribution<ll>(a, b)(mt_rng);
}

template<class T, class U> void vti(vt<T> &v, U x, size_t n) {
	v=vt<T>(n, x);
}
template<class T, class U> void vti(vt<T> &v, U x, size_t n, size_t m...) {
	v=vt<T>(n);
	EACH(a, v)
		vti(a, x, m);
}

const int d4i[4]={-1, 0, 1, 0}, d4j[4]={0, 1, 0, -1};
const int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};

void solve() {
    int a;
    read(a);
    vt<ll> y(a);
    read(y);
    int b;
    read(b);
    vt<ll> x(b);
    read(x);
    srtr(y);
    for(int i = 0;i<b;i++) {
        int ans = 0;
        for(int j = 0;j<x[i]-1;j++) {
            ans+=y[j];
        }
        for(int k = x[i];k<a;k++) {
            ans+=y[k];
        }
        print(ans);
    }
}

int main() {
    ios;

    test {
        solve();
    }
}