UVA12917 Prop hunt!

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4796 [PDF](https://uva.onlinejudge.org/external/129/p12917.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12917/3adbe790d8394738abe2e05445d715573ea74cba.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12917/5dfadaf7000ddbccb50eb5898f777f3bb0b78506.png)

Output Format

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