#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define debug cout << "Debug\n"
/*
---===ASCII help===---
'0' -> 48 '9' -> 57
'A' -> 65 'Z' -> 90
'a' -> 97 'z' -> 122
*/
inline void USACO(string filename){
freopen((filename + ".in").c_str(), "r", stdin);
freopen((filename + ".out").c_str(), "w", stdout);
}
const long long mod = 1000000007;
void solve(){
ll n; cin >> n;
vector<ll> arr(n), prefix(n + 1, 0);
for (int i = 0; i < n; i++) {
cin >> arr[i];
prefix[i + 1] = prefix[i] + arr[i];
}
vector<int> ans;
for (int i = 0; i < n - 1; i++) {
bitset<1000001> dp;
dp[0] = 1;
for (int j = i; j < n; j++) {
dp |= (dp << arr[j]);
ll k = (j - i + 1);
ll sum = prefix[j + 1] - prefix[i];
if (sum % 2 == 0 && k >= 2 && dp[sum / 2]) ans.push_back(k);
}
}
sort(all(ans));
cout << ans.size() << " ";
for (int x : ans) cout << x << " ";
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
cin >> t;
while (t--) {
solve();
}
}