UVA10032 Tug of War

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=973 [PDF](https://uva.onlinejudge.org/external/100/p10032.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10032/fa1e2999333f47b42359a8bf18d1dcaa5946b286.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10032/7180deea8d2145ab08262e6a5eed7ded392a2d04.png)