#include <bits/stdc++.h>
using namespace std;
long long T,n,s1,s2;
int a[1001];
long long s[1001];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> T;
while(T--)
{
cin >> n;
s[0] = 0;
bool ok = false;
for(int i = 1; i <= n; i++) cin >> a[i];
s[1] = a[1];
for(int i = 2; i <= n; i++) s[i] = s[i-1] + a[i];
for(int i = 1; i <= n; i++)
{
s1 = s[i-1];
s2 = s[n] - s[i];
if(s1 == s2) {
cout << i << endl;
ok=true;
break;
}
}
if(ok == false) cout << -1 << endl;
}
return 0;
}
//ewwww... brother ewwwwwwwwww... whats that? whats that
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpsb25nIGxvbmcgVCxuLHMxLHMyOwppbnQgYVsxMDAxXTsKbG9uZyBsb25nIHNbMTAwMV07CmludCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBjaW4udGllKE5VTEwpOwogICAgY2luID4+IFQ7CiAgICB3aGlsZShULS0pCiAgICB7CiAgICAgICAgY2luID4+IG47CiAgICAgICAgc1swXSA9IDA7CiAgICAgICAgYm9vbCBvayA9IGZhbHNlOwogICAgICAgIGZvcihpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKSBjaW4gPj4gYVtpXTsKICAgICAgICBzWzFdID0gYVsxXTsKICAgICAgICBmb3IoaW50IGkgPSAyOyBpIDw9IG47IGkrKykgc1tpXSA9IHNbaS0xXSArIGFbaV07CiAgICAgICAgZm9yKGludCBpID0gMTsgaSA8PSBuOyBpKyspCiAgICAgICAgewogICAgICAgICAgICBzMSA9IHNbaS0xXTsKICAgICAgICAgICAgczIgPSBzW25dIC0gc1tpXTsKICAgICAgICAgICAgaWYoczEgPT0gczIpIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgaSA8PCBlbmRsOwogICAgICAgICAgICAgICAgb2s9dHJ1ZTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmKG9rID09IGZhbHNlKSBjb3V0IDw8IC0xIDw8IGVuZGw7CiAgICB9CiAgICByZXR1cm4gMDsKfQovL2V3d3d3Li4uIGJyb3RoZXIgZXd3d3d3d3d3d3cuLi4gd2hhdHMgdGhhdD8gd2hhdHMgdGhhdA==