UVA532 Dungeon Master

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=473 [PDF](https://uva.onlinejudge.org/external/5/p532.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA532/f5204064f9aec4c41d412eb29fbc006dac1f717c.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA532/30d36b3bfe984f90284eb870b4006708e8229767.png)