#include <iostream>
#include <algorithm>
using namespace std;
int t, n, i, ans, a[10];
int main() {
int t;
scanf("%d", &t);
while (t--) {
scanf("%d", &n);
for (i = 0 ; i < n; ++i) scanf("%d", a + i);
sort(a, a + n);
++a[0]; // https://a...content-available-to-author-only...g.com/wiki/index.php/AM-GM_Inequality
for (i = 0, ans = 1 ; i < n ; ++i) ans *= a[i];
printf("%d\n", ans);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCB0LCBuLCBpLCBhbnMsIGFbMTBdOwoKaW50IG1haW4oKSB7CiAgICBpbnQgdDsKICAgIHNjYW5mKCIlZCIsICZ0KTsKICAgIHdoaWxlICh0LS0pIHsKICAgICAgICBzY2FuZigiJWQiLCAmbik7CiAgICAgICAgZm9yIChpID0gMCA7IGkgPCBuOyArK2kpIHNjYW5mKCIlZCIsIGEgKyBpKTsKICAgICAgICBzb3J0KGEsIGEgKyBuKTsKICAgICAgICArK2FbMF07ICAgICAgICAgLy8gaHR0cHM6Ly9hLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5nLmNvbS93aWtpL2luZGV4LnBocC9BTS1HTV9JbmVxdWFsaXR5CiAgICAgICAgZm9yIChpID0gMCwgYW5zID0gMSA7IGkgPCBuIDsgKytpKSBhbnMgKj0gYVtpXTsKICAgICAgICBwcmludGYoIiVkXG4iLCBhbnMpOwogICAgfQogICAgcmV0dXJuIDA7Cn0=