UVA11942 Lumberjack Sequencing

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=229&page=show_problem&problem=3093 [PDF](https://uva.onlinejudge.org/external/119/p11942.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11942/c63018375b7b991e745b43763642eb314e5d05a2.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11942/5b616e32131221066886a33c40d3918360058555.png)

Output Format

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