#include using namespace std; int main(){ int T; cin >> T; for (int i = 0; i < T; i++){ int N; cin >> N; int ans = 0; vector f(N); for (int j = 0; j < N; j++){ cin >> f[j]; ans += f[j]; } cout << (ans + 1) % (N + 1) << endl; } }