#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<queue>
#define inc(i,l,r) for(int i=l;i<=r;i++)
#define dec(i,l,r) for(int i=l;i>=r;i--)
#define link(x) for(edge *j=h[x];j;j=j->next)
#define mem(a) memset(a,0,sizeof(a))
#define inf 100000
#define ll long long
#define succ(x) (1<<x)
#define lowbit(x) (x&&(-x))
#define NM 100005
using namespace std;
int read(){
int x=0,f=1;char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
return f*x;
}
int n,m,a[NM],b[NM],c[NM],d[NM],f0[NM],f1[NM],_x,_y;
ll t,ans1,ans2,ans,s1[50],s2[50],s[50],tmp,_ans,_ans1,_ans2;
int main(){
freopen("data.in","r",stdin);
m=30;
while(~scanf("%d",&n)){
tmp=0;mem(s);mem(s1);mem(s2);
inc(i,1,n)a[i]=read();
inc(i,1,n)tmp+=a[i];
t=1;ans=ans1=ans2=_ans=_ans1=_ans2=0;
inc(p,1,m){
mem(b);mem(c);mem(d);mem(f0);mem(f1);
_x=_y=n+1;
dec(i,n,1){
b[i]=_x;c[i]=_y;
if(a[i]%2)_x=i;else _y=i;
}
inc(i,1,n)d[i]=d[i-1]^(a[i]%2);
dec(i,n,1){
f1[i]=f1[i+1];f0[i]=f0[i+1];
if(d[i])f1[i]++;else f0[i]++;
}
inc(i,1,n){
if(a[i]%2)s1[p]+=c[i]-i-1,s2[p]+=n-i;
else s2[p]+=n+1-b[i];
if(d[i-1])s[p]+=f0[i+1];else s[p]+=f1[i+1];
}
// inc(i,1,n)printf("%d ",d[i]);printf("\n");
inc(i,1,n)a[i]>>=1;
t*=2;
}
t=2;ans1=ans2=ans=tmp;
inc(i,1,m){
ans1+=t*s1[i];_ans1+=ans1/inf;ans1%=inf;
ans2+=t*s2[i];_ans2+=ans2/inf;ans2%=inf;
ans+=t*s[i];_ans+=ans/inf;ans%=inf;
t<<=1;
}
t=(ll)n*n;
ans+=_ans%t*inf;_ans=_ans/t*inf+ans/t;ans%=t;ans+=_ans%10*t;_ans/=10;
ans1+=_ans1%t*inf;_ans1=_ans1/t*inf+ans1/t;ans1%=t;ans1+=_ans1%10*t;_ans1/=10;
ans2+=_ans2%t*inf;_ans2=_ans2/t*inf+ans2/t;ans2%=t;ans2+=_ans2%10*t;_ans2/=10;
if(_ans)printf("%lld",_ans);printf("%.3lf ",(double)ans/t);
if(_ans1)printf("%lld",_ans1);printf("%.3lf ",(double)ans1/t);
if(_ans2)printf("%lld",_ans2);printf("%.3lf\n",(double)ans2/t);
// printf("%lld %lld %lld\n",ans,ans1,ans2);
}
return 0;
}