UVA12079 Bowlstack

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=242&page=show_problem&problem=3231 [PDF](https://uva.onlinejudge.org/external/120/p12079.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12079/73c3cfaead9df2a5912367a17f4b247a5090d977.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12079/2898200c2ce99fcfdc3a5dc5e0b941fd64b0e201.png)