fork(1) download
  1. MOD = 10**9 + 7
  2. INF = 10**18
  3.  
  4. def solve():
  5. n = int(input())
  6. a = list(map(int, input().split()))
  7. count = 0
  8. total = 0
  9. for val in a:
  10. total += val
  11. if val == 0:
  12. count += 1
  13. print(total + count)
  14.  
  15.  
  16. t = int(input())
  17. for _ in range(t):
  18. solve()
  19.  
Success #stdin #stdout 0.08s 14080KB
stdin
2
3
0 1 1
3
1 2 3
stdout
3
6