【summary】mat 【万恶溢出!!】
教训:int*int除了考虑最后答案溢出还要考虑中间溢出呀!(唔。。虽然最后全部换成了LL)
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;typedef long double LD;
void read(LL& x)
{
char c = getchar();x = 0;bool flag = false;
while(c<'0'||c>'9')c=='-'?flag=true:1,c=getchar();
while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
flag?x=-x:1;
}
#define maxn 50010
LL n,a[maxn],b[maxn];
LL sum[maxn],sqsum[maxn];
LD ans = 0.0;
inline LD cal(int i,int k,LL s,LL ss){return ((LL)k*a[i]*a[i]-2LL*a[i]*s+ss)*1.0/n;}
int main(void)
{
#define ACK
#ifdef ACK
freopen("mat.in","r",stdin);
freopen("mat.out","w",stdout);
#endif
read(n);
for(int i=1;i<=n;i++)read(a[i]);
for(in