标签:span gcd info abs image std its cpe 技术
#include<bits/stdc++.h> using namespace std; int main(){ int T,n,m;scanf("%d",&T); while(T --){ scanf("%d",&n); long long nksum = 0, sum = 0; for(int i = 0; i < n; i ++){ scanf("%d", &m); nksum += 1LL * n * m * m; sum += abs(1LL * m); } long long a = nksum - sum * sum; long long b = n; long long gcd = __gcd(a, b); printf("%lld/%lld\n",a/gcd, b/gcd); } return 0; }
标签:span gcd info abs image std its cpe 技术
原文地址:https://www.cnblogs.com/wethura/p/9741261.html