close

思路蠻簡單的,新手向吧。就照要求。

代碼:  

for _ in range(int(input())):
    n = int(input())
    arr = list(map(int, input().split()))
    tot, pre = 0, 0
    for i in range(n):
        tot += pre + arr[i]//2
        pre += arr[i]
    print(tot)

arrow
arrow
    創作者介紹
    創作者 尾玉 的頭像
    尾玉

    louisfghbvc的部落格

    尾玉 發表在 痞客邦 留言(0) 人氣()