n=int(input())
l=list(map(int,input().split()))
q=int(input())
qer = [list(map(int,input().split())) for _ in range(q)]
for qr in qer:
if qr[0] == 1:
for i in range(qr[1]-1,qr[2]):
l[i]+=qr[-1]
elif qr[0] == 2:
s=0
for i in range(qr[1]-1,qr[2]):
s+=l[i]
print(s)
output
14
Help to sort out this plz