UVA270 Lining Up

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=4&page=show_problem&problem=206 [PDF](https://uva.onlinejudge.org/external/2/p270.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA270/ce489f13fe47a06ba7e9b3eeabce7cc709e816e4.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA270/92601362ef602c3a2e12ec2cbb7d2683f1fa2162.png)