// Problem: A - Century
// Contest: AtCoder - KYOCERA Programming Contest 2021（AtCoder Beginner Contest 200）
// URL: https://atcoder.jp/contests/abc200/tasks/abc200_a
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Made by Licykoc 
// 
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
#define UP(x,l,r) for (int x=l;x<=r;++x)
#define DOWN(x,l,r) for (int x=l;x>=r;--x)
#define IOS ios::sync_with_stdio(0),cin.tie(0)
#define low(x) (x&(-x))
#define fi first
#define se second
#define pb push_back
#define isdigit(c) (c>='0'&&c<='9')
using namespace std;
inline void read (int &x) {
	char c=getchar(); int w=0; x=0;
	for (;!isdigit(c);c=getchar()) w^=!(c^45);
	for (;isdigit(c);c=getchar()) x=(x*10)+(c^48);
	x=w?-x:x;
}
int n;
int main () {
	read(n);
	printf("%d\n",(n-1)/100+1);
}
/**
    BISMILLAH
    @Author : Arham
*/

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n'
using pii = pair<int, int>;

ll sq(int val) {
    return (ll)(val*val);
}

void think(int id) { // Dummy_Argument?
    int n;
    vector<int> v;
    cin >> n;
    for(int i = 0, val; i < n; i++) {
        cin >> val;
        v.emplace_back(val);
    } ll tot = 0, tmp = 0, sum[n];
    for(int i = 0; i < n; i++) {
        tot += (ll)(sq(v[i])*(ll)(n-1));
    } for(int i = 0; i < n; i++) {
        tmp += v[i];
        sum[i] = tmp;
    } for(int i = 0; i < n; i++) {
        tot -= (ll)(2*v[i]*((sum[n-1]-sum[i])) );
    } cout << tot << endl;

    return;
}

int32_t main() {
    int t = 1, id = 1;

    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r+", stdin);
    freopen("out.txt", "w+", stdout);
    scanf("%d", &t);
    #endif

    while(t--)
    think(id++);

    return 0;
}
