UVA284 Logic

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=4&page=show_problem&problem=220 [PDF](https://uva.onlinejudge.org/external/2/p284.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA284/d24bb103f8779d184f8ab28c50e899d6962cf446.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA284/812513011a42da7bf5bed863216f44abc6a084e9.png)