UVA10497 Sweet Child Makes Trouble

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1438 [PDF](https://uva.onlinejudge.org/external/104/p10497.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10497/e963d16790505378d172b699b96fccc7fab43e12.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10497/3cbcb07a53df2a03bd436536f98dedf8f4c8d470.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10497/150c1d6c46b6ab45a77e1a16f8d656ee483556cc.png)