UVA10623 Thinking Backward

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=18&page=show_problem&problem=1564 [PDF](https://uva.onlinejudge.org/external/106/p10623.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10623/d35967297a31eccc75d04bef7a41b4ea27aa9d80.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10623/24912ec0f4c297755414de4ce19eedaf9b73fc11.png)

Output Format

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