UVA11672 Dynamic Summation

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=78&page=show_problem&problem=2719 [PDF](https://uva.onlinejudge.org/external/116/p11672.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11672/623c770a49395924bfd041b2ec6b7be4f826ce31.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11672/d7823ea2ade6801627e157850d4c9f5a942e2b09.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11672/75eee7ea478690f0ecf4dd7fd5b8b1e21aab6f65.png)