| 51 | } |
| 52 | |
| 53 | int main() { |
| 54 | int q; scanf("%d",&q); |
| 55 | while(q--) { |
| 56 | memset(dp, -1, sizeof(dp)); |
| 57 | scanf("%d",&n); |
| 58 | for(int i=0;i<n;i++) scanf("%d",&arr[i]); |
| 59 | |
| 60 | // the only permutation that we care |
| 61 | sort(arr, arr+n); |
| 62 | int ans = solve(0,0); |
| 63 | printf("%d\n",ans); |
| 64 | } |
| 65 | return 0; |
| 66 | } |