i am continuously getting WA in [kingship][1]

what’s the reason??

here is the code

```
#include <cstdio>
using namespace std;
int main() {
int t;
scanf("%d", &t);
while (t--) {
long long int n, arr[100005], i, min;
scanf("%ld", &n);
long long int res = 0, cnt = 0;
if (n == 1) {
res = 0;
} else {
scanf("%ld", &arr[0]);
min = arr[0];
for (i = 1;i < n;i++) {
scanf("%ld", &arr[i]);
if (min > arr[i]) {
min = arr[i];
}
}
for (i = 0;i < n;i++) {
if (arr[i] == min && cnt == 0) {
cnt++;
continue;
}
res += (arr[i] * min);
}
}
printf("%lld\n", res);
}
return 0;
```