UVA11446 Where is the 'back' button?

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=26&page=show_problem&problem=2441 [PDF](https://uva.onlinejudge.org/external/114/p11446.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11446/33dae8cb785b690df06cf76a5672428d57cc2fd8.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11446/1ddb367e456de2b0b3447a29aada5f46839f962b.png)