题解 | #Kevin is Counting Stars#
Kevin is Counting Stars
https://ac.nowcoder.com/acm/problem/261520
a.sort()
res = 0
for i in range(1, n - 1):
res += a[i]
if a[1] < a[n-1]:
res += 1
return res
t=int(input())
for i in range(t):
n=int(input())
b=list(map(int,input().split()))
print(solve(n,b))