Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
645 B
2
Indexable
Never
/**
     assalamualikom
     Md shafayat karim
     CSE, International Islamic University Chittagong
 
 */
 
 
 
 
#include<bits/stdc++.h>
using namespace std;
int main()
{
   int tc;
   cin>>tc;
   while(tc--){
       int digit;
       cin >> digit;
       int arr[digit];
 
       for(int j = 0; j < digit; j++)
       {
           cin >> arr[j];
       }
 
       sort(arr, arr + digit);
 
       arr[0] += 1;
       long long final_shot = 1;
 
       for(int j = 0; j < digit; j++)
       {
           final_shot *= arr[j];
 
       }
       cout << final_shot << endl;
 
   }
 
 
 
    return 0;
}