#include using namespace std; #define ll long long const int N = 1005; int T, n, f[N], g[N]; int main() { scanf("%d", &T); while(T--){ scanf("%d", &n); for(int i=0; i