UVA399 Another Puzzling Problem

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=5&page=show_problem&problem=335 [PDF](https://uva.onlinejudge.org/external/3/p399.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA399/ca49b075f88ee251337f4ab46c1dd19557b20180.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA399/8217f3a44de396417502395d585c45f93b5f27ca.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA399/33076d39835f18c044c28776d6003e1f1e3203e4.png)