UVA10170 The Hotel with Infinite Rooms

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1111 [PDF](https://uva.onlinejudge.org/external/101/p10170.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10170/cbbbc2fdd1f9a2e3c454b2162c1d3c127455a81c.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10170/2cebe698a71d956a71dbaf2edc6f4223f1867595.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10170/621abfe0d543203a1ad62443c08f338fd022a71e.png)