I'm not sure whether I undertand the problem, but I think this answer is
right
I whill try another one.
the second understanding is right

But there's one more thing needs to pay attention:

the type of the sum: int is about 2 billion.

?I don't know how to evalute the sum?