UVA120 煎饼 Stacks of Flapjacks

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=56 [PDF](https://uva.onlinejudge.org/external/1/p120.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA120/e9de4fbc88c5e223cc5fd5e9274c040a16306129.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA120/2082d4b71346c83a4bdf366c2ef579b7a013f192.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA120/47eec848200d5aaa13dc0e2327e0aa6858219092.png)