## [THUPC2019] 不等式

#include<bits/stdc++.h>
#define re register
#define db double
#define LL long long
const int maxn=5e5+5;
char c=getchar();int x=0,r=1;while(c<'0'||c>'9'){if(c=='-')r=-1;c=getchar();}
while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+c-48,c=getchar();return x*r;
}
int a[maxn],b[maxn],id[maxn],pos[maxn],p[maxn],n;
int l[maxn*3],r[maxn*3];LL sa[maxn*3],sb[maxn*3],sum;
inline int cmp(int A,int B) {return 1ll*b[A]*a[B]>1ll*b[B]*a[A];}
void build(int x,int y,int i){
l[i]=x,r[i]=y;if(x==y){p[x]=i;return;}
int mid=x+y>>1;build(x,mid,i<<1),build(mid+1,y,i<<1|1);
}
inline void chg(int x,int va,int vb) {x=p[x];while(x)sa[x]+=va,sb[x]+=vb,x>>=1;}
int fid(int i,LL nw) {
if(l[i]==r[i])return l[i];
return sa[i<<1]>=nw?fid(i<<1,nw):fid(i<<1|1,nw-sa[i<<1]);
}
LL qry(int x,int y,int i,int o) {
if(x<=l[i]&&y>=r[i]) return !o?sa[i]:sb[i];
int mid=l[i]+r[i]>>1;LL tot=0;
tot=(x<=mid?qry(x,y,i<<1,o):0)+(y>mid?qry(x,y,i<<1|1,o):0);
}
int main() {
for(re int i=1;i<=n;i++)if(a[i]<0)a[i]=-a[i],b[i]=-b[i];
for(re int i=1;i<=n;i++)id[i]=i;std::sort(id+1,id+n+1,cmp);
for(re int i=1;i<=n;i++)pos[id[i]]=i;build(1,n,1);
for(re int t,i=1;i<=n;i++) {
chg(pos[i],a[i],-b[i]);t=fid(1,((sum+=a[i])+1)>>1);
db pnw=(db)(b[id[t]])/(db)(-a[id[t]]),ans=0;
ans=(db)qry(1,t,1,0)*pnw-qry(1,t,1,1)+qry(t,n,1,1)-(db)qry(t,n,1,0)*pnw;
printf("%.10lf\n",ans);
}
return 0;
}