This is the solution of the problem in python: lista=input().split(" ")count=len(lista)A=int(lista[0])for i in range(1,count+1): K=int(lista[i]) if(K>0): N=int(lista[i]) breakT=A+NSum=0for j in range(A,T): Sum=Sum+jprint(Sum)
No comments