#include #include using namespace std; int tn, ti, n, a[100000 + 5], i; int main (int argc, char * const argv[]) { scanf("%d", &tn); for(ti = 0; ti < tn; ti++) { // Input reading scanf("%d", &n); for(i = 1; i <= n; i++) scanf("%d", &a[i]); // The answer is the first + the second number in the array obtained by the sorting sort(a + 1, a + n + 1); printf("%d\n", a[1] + a[2]); } return 0; }